本文整理汇总了C#中FilterMode类的典型用法代码示例。如果您正苦于以下问题:C# FilterMode类的具体用法?C# FilterMode怎么用?C# FilterMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilterMode类属于命名空间,在下文中一共展示了FilterMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEventFilter
/// <summary>
/// Generate an event filter function with the required semantics
/// </summary>
/// <param name="mode">Filter for event visibility</param>
/// <returns>Comparison function</returns>
public static Func<TypeDefinition, EventDefinition, bool> GetEventFilter(FilterMode mode)
{
Func<TypeDefinition, EventDefinition, bool> func = (TypeDefinition typeDef, EventDefinition evDef) =>
{
var lret = false;
if (IsEnabled(mode, FilterMode.Public))
{
lret = evDef.AddMethod.IsPublic;
}
if (!lret && IsEnabled(mode, FilterMode.Protected))
{
if (evDef.AddMethod.IsAssembly && IsEnabled(mode, FilterMode.NotInternalProtected))
{
// skip internal events which could be protected
}
else
{
lret = evDef.AddMethod.IsFamily;
}
}
if (!lret && IsEnabled(mode, FilterMode.Private))
{
lret = evDef.AddMethod.IsPrivate;
}
if (!lret && IsEnabled(mode, FilterMode.Internal))
{
lret = evDef.AddMethod.IsAssembly;
}
return lret;
};
return func;
}
示例2: FilterValueControl
/// <summary>
/// Gets the filter value control with the specified FilterMode
/// </summary>
/// <param name="configurationValues">The configuration values.</param>
/// <param name="id">The identifier.</param>
/// <param name="required">if set to <c>true</c> [required].</param>
/// <param name="filterMode">The filter mode.</param>
/// <returns></returns>
public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required, FilterMode filterMode )
{
var control = new RockTextBox { ID = id };
control.ID = string.Format( "{0}_ctlCompareValue", id );
control.AddCssClass( "js-filter-control" );
return control;
}
示例3: FilterSource
internal unsafe FilterSource(FilePath path, FilterMode mode, git_filter_source* source)
{
SourceMode = mode;
ObjectId = ObjectId.BuildFromPtr(&source->oid);
Path = path.Native;
Root = Proxy.git_repository_workdir(new IntPtr(source->repository)).Native;
}
示例4: GetTextureList
/// <summary>
/// Get GIF texture list (This is a possibility of lock up)
/// </summary>
/// <param name="bytes">GIF file byte data</param>
/// <param name="loopCount">out Animation loop count</param>
/// <param name="width">out GIF image width (px)</param>
/// <param name="height">out GIF image height (px)</param>
/// <param name="filterMode">Textures filter mode</param>
/// <param name="wrapMode">Textures wrap mode</param>
/// <param name="debugLog">Debug Log Flag</param>
/// <returns>GIF texture list</returns>
public static List<GifTexture> GetTextureList (byte[] bytes, out int loopCount, out int width, out int height,
FilterMode filterMode = FilterMode.Bilinear, TextureWrapMode wrapMode = TextureWrapMode.Clamp, bool debugLog = false)
{
loopCount = -1;
width = 0;
height = 0;
// Set GIF data
var gifData = new GifData ();
if (SetGifData (bytes, ref gifData, debugLog) == false) {
Debug.LogError ("GIF file data set error.");
return null;
}
// Decode to textures from GIF data
var gifTexList = new List<GifTexture> ();
if (DecodeTexture (gifData, gifTexList, filterMode, wrapMode) == false) {
Debug.LogError ("GIF texture decode error.");
return null;
}
loopCount = gifData.appEx.loopCount;
width = gifData.logicalScreenWidth;
height = gifData.logicalScreenHeight;
return gifTexList;
}
示例5: DeblurBuilder
/// <summary>
/// Builder constructor
/// </summary>
/// <param name="filterSize"></param>
/// <param name="filterPower"></param>
/// <param name="keepOption"></param>
public DeblurBuilder(Size filterSize, double filterPower = 1, KeepOption keepOption = KeepOption.AverageAndDelta)
{
_filterMode = FilterMode.FilterSize;
_filterSize = filterSize;
_filterPower = filterPower;
_keepOption = keepOption;
}
示例6: ScreenNameQuery
public ScreenNameQuery(string key, string value, FilterMode mode) : base(key, value, mode)
{
if (mode != FilterMode.Regex)
{
this.screenName = new ScreenName(value);
}
}
示例7: Upgrade
public void Upgrade()
{
if (this.version != 4)
{
Debug.Log("SpriteCollection '" + base.name + "' - Upgraded from version " + this.version.ToString());
if (this.version == 0)
{
if (this.pixelPerfectPointSampled)
{
this.filterMode = FilterMode.Point;
}
else
{
this.filterMode = FilterMode.Bilinear;
}
this.userDefinedTextureSettings = true;
}
if (((this.version < 3) && (this.textureRefs != null)) && ((this.textureParams != null) && (this.textureRefs.Length == this.textureParams.Length)))
{
for (int i = 0; i < this.textureRefs.Length; i++)
{
this.textureParams[i].texture = this.textureRefs[i];
}
this.textureRefs = null;
}
if (this.version < 4)
{
this.sizeDef.CopyFromLegacy(this.useTk2dCamera, this.targetOrthoSize, (float) this.targetHeight);
}
this.version = 4;
}
}
示例8: FilterValueControl
/// <summary>
/// Gets the filter value control.
/// </summary>
/// <param name="configurationValues">The configuration values.</param>
/// <param name="id">The identifier.</param>
/// <param name="required">if set to <c>true</c> [required].</param>
/// <param name="filterMode">The filter mode.</param>
/// <returns></returns>
public override Control FilterValueControl( Dictionary<string, ConfigurationValue> configurationValues, string id, bool required, FilterMode filterMode )
{
var control = base.FilterValueControl(configurationValues, id, required, filterMode );
WorkflowTypePicker workflowTypePicker = (WorkflowTypePicker)control;
workflowTypePicker.Required = required;
workflowTypePicker.AllowMultiSelect = false;
return control;
}
示例9: ExtensionFilter
/// <summary>
/// Initialize the Extension Filter
/// </summary>
/// <param name="pattern">pattern for the extension filter</param>
/// <param name="mode">The <see cref="FilterMode"/> for Filter</param>
internal ExtensionFilter(string pattern,FilterMode mode):base(mode)
{
if(pattern == null){
pattern = "";
}
this._pattern = pattern;
BuildRegex(_pattern.ToLower());
}
示例10: FilterBuilder
/// <summary>
/// Builder constructor
/// </summary>
/// <param name="filterKernel"></param>
/// <param name="filterPower"></param>
/// <param name="keepOption"></param>
public FilterBuilder(Complex[,] filterKernel, double filterPower = 1,
KeepOption keepOption = KeepOption.AverageAndDelta)
{
_filterMode = FilterMode.FilterKernel;
_filterKernel = filterKernel;
_filterPower = filterPower;
_keepOption = keepOption;
}
示例11: Apply
public Stream Apply(Stream stream, FilterMode fm)
{
Rijndael des = Rijndael.Create();
des.IV = iv;
des.Key = key;
ICryptoTransform crypt = fm == FilterMode.Write ? des.CreateEncryptor() : des.CreateDecryptor();
CryptoStream cs = new CryptoStream(stream, crypt, fm == FilterMode.Write ? CryptoStreamMode.Write : CryptoStreamMode.Read);
return cs;
}
示例12: Get
public RenderTexture Get(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.ARGBHalf, RenderTextureReadWrite rw = RenderTextureReadWrite.Default, FilterMode filterMode = FilterMode.Bilinear, TextureWrapMode wrapMode = TextureWrapMode.Clamp, string name = "FactoryTempTexture")
{
var rt = RenderTexture.GetTemporary(width, height, depthBuffer, format);
rt.filterMode = filterMode;
rt.wrapMode = wrapMode;
rt.name = name;
m_TemporaryRTs.Add(rt);
return rt;
}
示例13: GetTemporaryRenderTexture
public RenderTexture GetTemporaryRenderTexture(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.ARGBHalf, FilterMode filterMode = FilterMode.Bilinear)
{
RenderTexture temporary = RenderTexture.GetTemporary(width, height, depthBuffer, format);
temporary.filterMode = filterMode;
temporary.wrapMode = TextureWrapMode.Clamp;
temporary.name = "RenderTextureUtilityTempTexture";
this.m_TemporaryRTs.Add(temporary);
return temporary;
}
示例14: DecodeTextureCoroutine
/// <summary>
/// Decode to textures from GIF data
/// </summary>
/// <param name="gifData">GIF data</param>
/// <param name="gifTexList">GIF texture list</param>
/// <param name="filterMode">Textures filter mode</param>
/// <param name="wrapMode">Textures wrap mode</param>
/// <returns>IEnumerator</returns>
static IEnumerator DecodeTextureCoroutine(GifData gifData, List<GifTexture> gifTexList, FilterMode filterMode, TextureWrapMode wrapMode)
{
if (gifData.imageBlockList == null || gifData.imageBlockList.Count < 1) {
yield break;
}
Color32? bgColor = GetGlobalBgColor (gifData);
// Disposal Method
// 0 (No disposal specified)
// 1 (Do not dispose)
// 2 (Restore to background color)
// 3 (Restore to previous)
ushort disposalMethod = 0;
int imgBlockIndex = 0;
foreach (var imgBlock in gifData.imageBlockList) {
var decodedData = GetDecodedData (imgBlock);
var colorTable = GetColorTable (gifData, imgBlock, ref bgColor);
var graphicCtrlEx = GetGraphicCtrlExt (gifData, imgBlockIndex);
int transparentIndex = GetTransparentIndex (graphicCtrlEx);
// avoid lock up
yield return 0;
bool useBeforeTex = false;
var tex = CreateTexture2D (gifData, gifTexList, imgBlockIndex, disposalMethod, filterMode, wrapMode, ref useBeforeTex);
// Set pixel data
int dataIndex = 0;
// Reverse set pixels. because GIF data starts from the top left.
for (int y = tex.height - 1; y >= 0; y--) {
SetTexturePixelRow (tex, y, imgBlock, decodedData, ref dataIndex, colorTable, bgColor, transparentIndex, useBeforeTex);
// avoid lock up
//if (y % 10 == 0) {
// yield return 0;
//}
}
tex.Apply ();
float delaySec = GetDelaySec (graphicCtrlEx);
// Add to GIF texture list
gifTexList.Add (new GifTexture (tex, delaySec));
disposalMethod = GetDisposalMethod (graphicCtrlEx);
imgBlockIndex++;
// avoid lock up
yield return 0;
}
}
示例15: GetTemporaryRenderTexture
public RenderTexture GetTemporaryRenderTexture(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.ARGBHalf, FilterMode filterMode = FilterMode.Bilinear)
{
var rt = RenderTexture.GetTemporary(width, height, depthBuffer, format);
rt.filterMode = filterMode;
rt.wrapMode = TextureWrapMode.Clamp;
rt.name = "RenderTextureUtilityTempTexture";
m_TemporaryRTs.Add(rt);
return rt;
}