当前位置: 首页>>代码示例>>C#>>正文


C# IFilter类代码示例

本文整理汇总了C#中IFilter的典型用法代码示例。如果您正苦于以下问题:C# IFilter类的具体用法?C# IFilter怎么用?C# IFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IFilter类属于命名空间,在下文中一共展示了IFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InstrumentationModelBuilderFactory

 public InstrumentationModelBuilderFactory(ICommandLine commandLine, IFilter filter, ILog logger, IEnumerable<ITrackedMethodStrategy> trackedMethodStrategies)
 {
     _commandLine = commandLine;
     _filter = filter;
     _logger = logger;
     MethodStrategies = trackedMethodStrategies;
 }
开发者ID:cerilewis,项目名称:opencover,代码行数:7,代码来源:InstrumentationModelBuilderFactory.cs

示例2: GetFeatureGETRequest

        /// <summary>
        /// This method returns the query string for 'GetFeature'.
        /// </summary>
        /// <param name="featureTypeInfo">A <see cref="WfsFeatureTypeInfo"/> instance providing metadata of the featuretype to query</param>
        /// <param name="labelProperty"></param>
        /// <param name="boundingBox">The bounding box of the query</param>
        /// <param name="filter">An instance implementing <see cref="IFilter"/></param>
        public string GetFeatureGETRequest(WfsFeatureTypeInfo featureTypeInfo, string labelProperty, BoundingBox boundingBox, IFilter filter)
        {
            string qualification = string.IsNullOrEmpty(featureTypeInfo.Prefix)
                                       ? string.Empty
                                       : featureTypeInfo.Prefix + ":";
            string filterString = string.Empty;

            if (filter != null)
            {
                filterString = filter.Encode();
                filterString = filterString.Replace("<", "%3C");
                filterString = filterString.Replace(">", "%3E");
                filterString = filterString.Replace(" ", "");
                filterString = filterString.Replace("*", "%2a");
                filterString = filterString.Replace("#", "%23");
                filterString = filterString.Replace("!", "%21");
            }

            var filterBuilder = new StringBuilder();
            filterBuilder.Append("&filter=%3CFilter%20xmlns=%22" + NSOGC + "%22%20xmlns:gml=%22" + NSGML +
                                 "%22%3E%3CBBOX%3E%3CPropertyName%3E");
            filterBuilder.Append(qualification).Append(featureTypeInfo.Geometry.GeometryName);
            filterBuilder.Append("%3C/PropertyName%3E%3Cgml:Box%20srsName=%22" + featureTypeInfo.SRID + "%22%3E");
            filterBuilder.Append("%3Cgml:coordinates%3E");
            filterBuilder.Append(XmlConvert.ToString(boundingBox.Left) + ",");
            filterBuilder.Append(XmlConvert.ToString(boundingBox.Bottom) + "%20");
            filterBuilder.Append(XmlConvert.ToString(boundingBox.Right) + ",");
            filterBuilder.Append(XmlConvert.ToString(boundingBox.Top));
            filterBuilder.Append("%3C/gml:coordinates%3E%3C/gml:Box%3E%3C/BBOX%3E");
            filterBuilder.Append(filterString);
            filterBuilder.Append("%3C/Filter%3E");

            return "?SERVICE=WFS&Version=1.0.0&REQUEST=GetFeature&TYPENAME=" + qualification + featureTypeInfo.Name +
                   "&SRS =" + featureTypeInfo.SRID + filterBuilder;
        }
开发者ID:pauldendulk,项目名称:Mapsui,代码行数:42,代码来源:WFS_1_0_0_TextResources.cs

示例3: ConsoleAppender

 public ConsoleAppender(ISubmitConsoleLogEntry consoleLogEntrySubmitter, bool forceConsoleOutput, IFilter filter, IColorSchema colorSchema)
 {
     m_consoleLogEntrySubmitter = consoleLogEntrySubmitter;
     m_colorSchema = colorSchema;
     m_filter = filter;
     if (forceConsoleOutput)
     {
         m_isConsoleOutputAvaliable = true;
     }
     else
     {
         if (IsRunningOnMono)
         {
             m_isConsoleOutputAvaliable = true;
         }
         else // Windows
         {
             IntPtr iStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
             if (iStdOut == IntPtr.Zero)
             {
                 m_isConsoleOutputAvaliable = false;
             }
             else
             {
                 m_isConsoleOutputAvaliable = true;
             }
         }
     }
 }
开发者ID:ronenbarak,项目名称:Whitelog,代码行数:29,代码来源:ColorAppender.cs

示例4: WriteProperty

		private static void WriteProperty(JsonWriter writer, IFilter filter, string field, object value)
		{
			if ((field.IsNullOrEmpty() || value == null))
				return;
			writer.WritePropertyName(field);
			writer.WriteValue(value);
		}
开发者ID:modulexcite,项目名称:Transformalize,代码行数:7,代码来源:GeoDistanceRangeFilterConverter.cs

示例5: DynamicApiActionInfo

 /// <summary>
 /// Createa a new <see cref="DynamicApiActionInfo"/> object.
 /// </summary>
 /// <param name="actionName">Name of the action in the controller</param>
 /// <param name="verb">The HTTP verb that is used to call this action</param>
 /// <param name="method">The method which will be invoked when this action is called</param>
 public DynamicApiActionInfo(string actionName, HttpVerb verb, MethodInfo method, IFilter[] filters = null)
 {
     ActionName = actionName;
     Verb = verb;
     Method = method;
     Filters = filters ?? new IFilter[] { }; //Assigning or initialzing the action filters.
 }
开发者ID:zhongkai1010,项目名称:OneWork,代码行数:13,代码来源:DynamicApiMethodInfo.cs

示例6: CrossStereoFilter

		/// <summary>
		/// Hll = Hrr, Hlr = Hrlの場合。
		/// </summary>
		/// <param name="ll">特性 Hll を持つフィルタ</param>
		/// <param name="lr">特性 Hlr を持つフィルタ</param>
		public CrossStereoFilter(IFilter ll, IFilter lr)
		{
			this.ll = ll;
			this.lr = lr;
			this.rl = (IFilter)lr.Clone();
			this.rr = (IFilter)ll.Clone();
		}
开发者ID:ufcpp,项目名称:UfcppSample,代码行数:12,代码来源:FilterAdapter.cs

示例7: FilteredSerializationDataProvider

		public FilteredSerializationDataProvider(string connectionStringName, IFilter filter)
			: base(connectionStringName)
		{
			Assert.ArgumentNotNull(filter, "filter");

			_filter = filter;
		}
开发者ID:Vittel,项目名称:Rhino,代码行数:7,代码来源:FilteredSerializationDataProvider.cs

示例8: ApplyFilter

        private void ApplyFilter(IFilter filter)
        {
            try
            {
                // set wait cursor
                this.Cursor = Cursors.WaitCursor;

                // apply filter to the image
                Bitmap newImage = filter.Apply((Bitmap)this.Image.Image);

                if (backup == null)
                {
                    backup = this.Image.Image;
                }

                this.Image.Image = newImage;

            }
            catch (ArgumentException)
            {
                MessageBox.Show("Selected filter can not be applied to the image", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
开发者ID:dalinhuang,项目名称:appcollection,代码行数:27,代码来源:FormDetailedPic.cs

示例9: MatchesFilterConditions

        protected virtual bool MatchesFilterConditions(LoggingEvent loggingEvent, IFilter filter)
        {
            if (filter.MinLevel != LoggingEventLevel.None && loggingEvent.Level < filter.MinLevel)
                return false;

            if (filter.MaxLevel != LoggingEventLevel.None && loggingEvent.Level > filter.MaxLevel)
                return false;

            if (!filter.LogKeyContains.IsNullOrEmpty() && loggingEvent.LogKey.IndexOf(filter.LogKeyContains, StringComparison.OrdinalIgnoreCase) < 0)
                return false;

            if (!filter.LogKeyStartsWith.IsNullOrEmpty() && !loggingEvent.LogKey.StartsWith(filter.LogKeyStartsWith, StringComparison.OrdinalIgnoreCase))
                return false;

            if (!filter.TextContains.IsNullOrEmpty() && loggingEvent.Text.IndexOf(filter.TextContains, StringComparison.OrdinalIgnoreCase) < 0)
                return false;

            if (!filter.TextStartsWith.IsNullOrEmpty() && !loggingEvent.Text.StartsWith(filter.TextStartsWith, StringComparison.OrdinalIgnoreCase))
                return false;

            if (filter.MinValue.HasValue && loggingEvent.Value.HasValue && loggingEvent.Value.Value < filter.MinValue.Value)
                return false;

            if (filter.MaxValue.HasValue && loggingEvent.Value.HasValue && loggingEvent.Value.Value > filter.MaxValue.Value)
                return false;

            if (!filter.TagsContains.IsNullOrEmpty())
            {
                var requiredTags = TagHelpers.Clean(filter.TagsContains);
                if (!requiredTags.All(x => loggingEvent.Tags.Contains(x, StringComparer.OrdinalIgnoreCase)))
                    return false;
            }

            return true;
        }
开发者ID:eduardocampano,项目名称:pulsus,代码行数:35,代码来源:DefaultEventDispatcher.cs

示例10: CecilSymbolManager

 public CecilSymbolManager(ICommandLine commandLine, IFilter filter, ILog logger, IEnumerable<ITrackedMethodStrategy> trackedMethodStrategies)
 {
     _commandLine = commandLine;
     _filter = filter;
     _logger = logger;
     _trackedMethodStrategies = trackedMethodStrategies ?? new ITrackedMethodStrategy[0];
 }
开发者ID:cerilewis,项目名称:opencover,代码行数:7,代码来源:CecilSymbolManager.cs

示例11: SetFilter

        private void SetFilter(string propertyName, IFilter filter)
        {
            if (updateFilterTimer != null)
            {
                updateFilterTimer.Dispose();
                updateFilterTimer = null;
            }

            if (filters.ContainsKey(propertyName))
            {
                if (filter == null)
                    filters.Remove(propertyName);
                else
                    filters[propertyName] = filter;
            }
            else
            {
                if (filter != null)
                    filters.Add(propertyName, filter);
            }

            updateFilterTimer = new Timer((s) => 
            {
                var scheduler = (TaskScheduler)s;
                updateFilterTimer.Dispose();
                updateFilterTimer = null;

                Task.Factory.StartNew(() => Source.SetFilter(filters.Select(f => new PropertyFilter(f.Key, f.Value)).ToArray(), CancellationToken.None), CancellationToken.None, TaskCreationOptions.None, scheduler);
            }, TaskScheduler.FromCurrentSynchronizationContext(), TimeSpan.FromMilliseconds(200), TimeSpan.FromTicks(0));
        }
开发者ID:kblc,项目名称:astrosoft.test,代码行数:30,代码来源:MainWindowViewModel.cs

示例12: InstrumentationModelBuilderFactory

 public InstrumentationModelBuilderFactory(ICommandLine commandLine, IFilter filter, ILog logger, ITrackedMethodStrategyManager trackedMethodStrategyManager)
 {
     _commandLine = commandLine;
     _filter = filter;
     _logger = logger;
     _trackedMethodStrategyManager = trackedMethodStrategyManager;
 }
开发者ID:jayrowe,项目名称:opencover,代码行数:7,代码来源:InstrumentationModelBuilderFactory.cs

示例13: DynamicApiActionInfo

 /// <summary>
 /// 初始化一个新的<see cref="DynamicApiActionInfo"/>实例
 /// </summary>
 /// <param name="actionName">Action 名称</param>
 /// <param name="verb">HTTP Verb</param>
 /// <param name="method">一个方法信息,随着 Action 的调用而调用</param>
 /// <param name="filters">用于 Controller Action 的动态筛选器</param>
 public DynamicApiActionInfo(string actionName, HttpVerbs verb, MethodInfo method, IFilter[] filters = null)
 {
     ActionName = actionName;
     Verb = verb;
     Method = method;
     Filters = filters ?? new IFilter[] { };
 }
开发者ID:yangganggood,项目名称:EMP,代码行数:14,代码来源:DynamicApiActionInfo.cs

示例14: FilterValue

 public FilterValue(string title, IFilter filter, IFilter selectAttributeFilter, MLFilterCriterion criterion)
 {
   _title = title;
   _filter = filter;
   _selectAttributeFilter = selectAttributeFilter;
   _criterion = criterion;
 }
开发者ID:BigGranu,项目名称:MediaPortal-2,代码行数:7,代码来源:FilterValue.cs

示例15: GetAvailableValues

 public override ICollection<FilterValue> GetAvailableValues(IEnumerable<Guid> necessaryMIATypeIds, IFilter selectAttributeFilter, IFilter filter)
 {
   IContentDirectory cd = ServiceRegistration.Get<IServerConnectionManager>().ContentDirectory;
   if (cd == null)
     throw new NotConnectedException("The MediaLibrary is not connected");
   HomogenousMap valueGroups = cd.GetValueGroups(MediaAspect.ATTR_RECORDINGTIME, null, ProjectionFunction.DateToYear,
       necessaryMIATypeIds, filter, true);
   IList<FilterValue> result = new List<FilterValue>(valueGroups.Count);
   int numEmptyEntries = 0;
   foreach (KeyValuePair<object, object> group in valueGroups)
   {
     int? year = (int?) group.Key;
     if (year.HasValue)
     {
       result.Add(new FilterValue(year.Value.ToString(),
           new BooleanCombinationFilter(BooleanOperator.And, new IFilter[]
             {
                 new RelationalFilter(MediaAspect.ATTR_RECORDINGTIME, RelationalOperator.GE, new DateTime(year.Value, 1, 1)),
                 new RelationalFilter(MediaAspect.ATTR_RECORDINGTIME, RelationalOperator.LT, new DateTime(year.Value + 1, 1, 1)),
             }), null, (int) group.Value, this));
     }
     else
       numEmptyEntries += (int) group.Value;
   }
   if (numEmptyEntries > 0)
     result.Insert(0, new FilterValue(Consts.RES_VALUE_EMPTY_TITLE, new EmptyFilter(MediaAspect.ATTR_RECORDINGTIME), null, numEmptyEntries, this));
   return result;
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:28,代码来源:FilterByYearCriterion.cs


注:本文中的IFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。