public override int Read(byte[] buffer, int offset, int size)
{
// current position not in current mapping?
if (position < mapOffset)
{
// relocate the view
}
// compute how many bytes can be read from the current segment
int read = Math.Min(size, (mapOffset + mapSize) - position);
// copy those bytes to the buffer
Marshal.Copy(...);
position += read;
if (size > read)
{
// recurse for the remaining bytes
read += Read(buffer, offset + read, size - read);
}
return read;
}
要求说明:
答案 0 :(得分:4)
$(document).ready(function(){
$('.chosen-select').chosen({});
$('.chosen-select').on('change', function(evt, params) {
var $s = $(this);
if (params.selected && params.selected == "Any")
{
// disable the select
$s.children('option').not(':selected').each(function(){
$(this).attr('disabled','disabled');
});
}
else if (params.deselected && params.deselected == "Any")
{
// enable back
$s.children('option').each(function(){
$(this).removeAttr('disabled');
});
}
// force chosen update
$('.chosen-select').trigger('chosen:updated');
});
});
答案 1 :(得分:0)
$(document).ready(function () {
$("#foobar").chosen().on('chosen:showing_dropdown',function() {
$('.chosen-select').attr('disabled', true).trigger('chosen:updated');
$('.chosen-select').attr('disabled', false).trigger('chosen:updated');
$('.search-choice-close').hide();
});
$('.search-choice-close').hide();
});