本文整理汇总了C#中FilterState类的典型用法代码示例。如果您正苦于以下问题:C# FilterState类的具体用法?C# FilterState怎么用?C# FilterState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilterState类属于命名空间,在下文中一共展示了FilterState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FilterContext
public FilterContext(ObjectCache cache, CompositionContainer container, IAssetResolver assetResolver, FilterState state)
{
this.Container = container;
this.Cache = cache;
this.AssetResolver = assetResolver;
this.State = state;
}
示例2: RestoreFilterState
/// <summary>
/// Restores filter state from the specified object.
/// </summary>
/// <param name="state">The object that holds the filter state.</param>
public override void RestoreFilterState(FilterState state)
{
EnsureChildControls();
base.RestoreFilterState(state);
drpOptions.SelectedIndex = state.GetInt32("RuleCategory");
}
示例3: FilterContext
public FilterContext(ObjectCache cache, CompositionContainer container, FilterState state, params IAssetFilter[] filters)
{
this.Container = container;
this.Cache = cache;
this.State = state;
this._filters = filters;
}
示例4: RestoreFilterState
/// <summary>
/// Restores filter state from the specified object.
/// </summary>
/// <param name="state">The object that holds the filter state.</param>
public override void RestoreFilterState(FilterState state)
{
base.RestoreFilterState(state);
isAdvancedMode = state.GetBoolean("AdvancedMode");
ViewState["IsAdvancedMode"] = isAdvancedMode;
ShowFilterElements(isAdvancedMode);
fltTimeBetween.ValueFromTime = state.GetDateTime("TimeBetweenFrom");
fltTimeBetween.ValueToTime = state.GetDateTime("TimeBetweenTo");
}
示例5: GlobalFilters
public GlobalFilters(Guid OrgId, int DeptID, int UserID)
{
DataRow _row = SelectState(OrgId, DeptID, UserID);
if (_row == null) return;
if ((bool)_row["btGlobalFilterEnabled"]) m_State = FilterState.EnabledGlobalFilters;
else if ((bool)_row["btLimitToAssignedTkts"]) m_State = FilterState.LimitToAssignedTickets;
else if ((bool)_row["btDisabledReports"]) m_State = FilterState.DisabledReports;
DataTable _dt = SelectFilterByType(OrgId, DeptID, UserID, FilterType.GlobalFilterTypes);
foreach (DataRow _r in _dt.Rows)
if ((bool)_r["State"]) m_Type[(int)_r["Filter"]] = true;
}
示例6: MainDlg
public MainDlg()
{
InitializeComponent();
try
{
m_pPlayer = new ClipPlayer(this.Handle, MSG_ENDOFSEGMENT, MSG_DSEVENT);
m_bTracking = false;
m_State = FilterState.Stopped;
}
catch
{
MessageBox.Show("Please register GMFBridge.DLL with regsvr32");
}
}
示例7: MpqFileSourceFilter
public MpqFileSourceFilter(MpqFile file)
{
CopyMediaTypes(detectedMediaType, defaultMediaType);
name = "Stream Source Filter";
filterState = FilterState.Stopped;
var extension = Path.GetExtension(file.Name);
try
{
using (var mediaTypeKey = Registry.ClassesRoot.OpenSubKey(@"Media Type"))
{
if (extension != null && extension.Length > 1)
try
{
using (var extensionsKey = mediaTypeKey.OpenSubKey(@"Extensions"))
using (var extensionKey = extensionsKey.OpenSubKey(extension))
{
var mediaType = new Guid(extensionKey.GetValue("Media Type", MediaType.Stream.ToString()) as string);
var subType = new Guid(extensionKey.GetValue("SubType", MediaSubType.None.ToString()) as string);
if (mediaType == MediaType.Stream && subType != MediaSubType.None && subType != MediaSubType.Null)
{
detectedMediaType.majorType = mediaType;
detectedMediaType.subType = subType;
return;
}
}
}
catch (Exception) { }
using (var streamMediaKey = mediaTypeKey.OpenSubKey(MediaType.Stream.ToString()))
foreach (var subTypeKeyName in streamMediaKey.GetSubKeyNames())
try
{
using (var subTypeKey = streamMediaKey.OpenSubKey(subTypeKeyName))
;
}
catch (Exception) { }
}
}
catch (Exception) { }
finally { outputPin = new StreamOutputPin(this); }
}
示例8: IncrementToken
public override bool IncrementToken()
{
if (currentState == FilterState.Init)
{
if (!input.IncrementToken())
return false;
}
currentState = (FilterState) ((int) currentState + 1);
switch (currentState)
{
case FilterState.WholePath:
return true;
case FilterState.File:
return SetTermToFileName();
case FilterState.FileWithoutExtension:
return RemoveExtension();
default:
return NextFileNamePart();
}
return false;
}
示例9: Filter
/// <summary>
/// Filter the specified input.
/// </summary>
/// <remarks>Filters the specified input buffer starting at the given index,
/// spanning across the specified number of bytes.</remarks>
/// <returns>The filtered output.</returns>
/// <param name="input">The input buffer.</param>
/// <param name="startIndex">The starting index of the input buffer.</param>
/// <param name="length">Length.</param>
/// <param name="outputIndex">Output index.</param>
/// <param name="outputLength">Output length.</param>
/// <param name="flush">If set to <c>true</c> flush.</param>
protected override byte[] Filter (byte[] input, int startIndex, int length, out int outputIndex, out int outputLength, bool flush)
{
int endIndex = startIndex + length;
int index = startIndex;
// read the compressed size if we haven't already...
if (state == FilterState.CompressedSize) {
if (!TryReadInt32 (input, ref index, endIndex, out compressedSize)) {
outputLength = 0;
outputIndex = 0;
return input;
}
state = FilterState.UncompressedSize;
compressedSize -= 12;
}
// read the uncompressed size if we haven't already...
if (state == FilterState.UncompressedSize) {
if (!TryReadInt32 (input, ref index, endIndex, out uncompressedSize)) {
outputLength = 0;
outputIndex = 0;
return input;
}
state = FilterState.Magic;
}
// read the compression mode magic if we haven't already...
if (state == FilterState.Magic) {
int magic;
if (!TryReadInt32 (input, ref index, endIndex, out magic)) {
outputLength = 0;
outputIndex = 0;
return input;
}
CompressionMode = (RtfCompressionMode) magic;
state = FilterState.Crc32;
}
// read the crc32 checksum if we haven't already...
if (state == FilterState.Crc32) {
if (!TryReadInt32 (input, ref index, endIndex, out checksum)) {
outputLength = 0;
outputIndex = 0;
return input;
}
state = FilterState.BeginControlRun;
}
if (CompressionMode != RtfCompressionMode.Compressed) {
// the data is not compressed, just keep track of the CRC32 checksum
crc32.Update (input, index, endIndex - index);
outputLength = Math.Max (Math.Min (endIndex - index, compressedSize - size), 0);
size += outputLength;
outputIndex = index;
return input;
}
int extra = Math.Abs (uncompressedSize - compressedSize);
int estimatedSize = (endIndex - index) + extra;
EnsureOutputSize (Math.Max (estimatedSize, 4096), false);
outputLength = 0;
outputIndex = 0;
while (index < endIndex) {
byte value = input[index++];
crc32.Update (value);
size++;
switch (state) {
case FilterState.BeginControlRun:
flags = value;
flagCount = 1;
if ((flags & 0x1) != 0)
state = FilterState.ReadControlOffset;
else
state = FilterState.ReadLiteral;
break;
case FilterState.ReadLiteral:
//.........这里部分代码省略.........
示例10: StoreFilterState
/// <summary>
/// Stores filter state to the specified object.
/// </summary>
/// <param name="state">The object that holds the filter state.</param>
public override void StoreFilterState(FilterState state)
{
state.AddValue("type", filter.SelectedValue);
}
示例11: RestoreFilterState
/// <summary>
/// Restores filter state from the specified object.
/// </summary>
/// <param name="state">The object that holds the filter state.</param>
public override void RestoreFilterState(FilterState state)
{
filter.SelectedValue = state.GetString("type");
}
示例12: btnStop_Click
private void btnStop_Click(object sender, EventArgs e)
{
if (state == FilterState.Stopped) return;
if (_mediaCtrl != null)
{
int hr = _mediaCtrl.Stop();
DsError.ThrowExceptionForHR(hr);
state = FilterState.Stopped;
}
// Seek back to the start.
if (_mediaPos != null)
{
_offsetseek = 0;
seekbar.Value = 0;
_mediaPos.put_CurrentPosition(0);
}
}
示例13: RestoreFilterState
/// <summary>
/// Restores filter state from the specified object.
/// </summary>
/// <param name="state">The object that holds the filter state.</param>
public override void RestoreFilterState(FilterState state)
{
base.RestoreFilterState(state);
Value = state.GetString("Value");
}
示例14: GetState
public int GetState(int dwMilliSecsTimeout, out FilterState filtState)
{
filtState = filterState;
return S_OK;
}
示例15: StoreFilterState
/// <summary>
/// Stores filter state to the specified object.
/// </summary>
/// <param name="state">The object that holds the filter state.</param>
public override void StoreFilterState(FilterState state)
{
state.AddValue("condition", filter.SelectedValue);
state.AddValue("email", txtEmail.Text);
}