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


C# ISelector类代码示例

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


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

示例1: With

 internal ChildSelector With(Int32 step, Int32 offset, ISelector kind)
 {
     _step = step;
     _offset = offset;
     _kind = kind;
     return this;
 }
开发者ID:fjwuyongzhi,项目名称:AngleSharp,代码行数:7,代码来源:ChildSelector.cs

示例2: PropertyReflectionStrategy

        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyReflectionStrategy"/> class.
        /// </summary>
        /// <param name="selector">The selector component.</param>
        /// <param name="injectorFactory">The injector factory component.</param>
        public PropertyReflectionStrategy(ISelector selector, IInjectorFactory injectorFactory)
        {
            Ensure.ArgumentNotNull(selector, "selector");
            Ensure.ArgumentNotNull(injectorFactory, "injectorFactory");

            Selector = selector;
            InjectorFactory = injectorFactory;
        }
开发者ID:schambers,项目名称:ninject,代码行数:13,代码来源:PropertyReflectionStrategy.cs

示例3: CreateCacheableWrapper

    /// <summary>
    /// 创建现有 CSS 选择器的自动缓存包装
    /// </summary>
    /// <param name="selector">已有的 CSS 选择器</param>
    /// <returns>对已有选择器的自动缓存的包装</returns>
    public static ISelector CreateCacheableWrapper( ISelector selector )
    {
      var cacheable = selector as CacheableSelector;
      if ( cacheable == null )
        cacheable = new CacheableCssSelectorWrapper( selector );

      return cacheable;
    }
开发者ID:ajayumi,项目名称:Jumony,代码行数:13,代码来源:CacheableSelector.cs

示例4: IsEligible

    protected override bool IsEligible( ISelector leftSelector, IHtmlElement element )
    {
      var restrict = leftSelector as ContainerRestrict;
      if ( restrict != null )
        return restrict.RestrictContainer.Nodes().Contains( element );

      return leftSelector.IsEligibleBuffered( element.Parent() );
    }
开发者ID:ajayumi,项目名称:Jumony,代码行数:8,代码来源:CssRelativeSelector.cs

示例5: SelectDocument

 public string SelectDocument(ISelector selector)
 {
     IElementSelector elementSelector = selector as IElementSelector;
     if (elementSelector != null)
     {
         return elementSelector.Select(Document);
     }
     return selector?.Select(GetFirstSourceText());
 }
开发者ID:hwpayg,项目名称:DotnetSpider,代码行数:9,代码来源:Html.cs

示例6: MultiSelector

 public MultiSelector(
     IRangeSelector rangeSelector,
     ISelector inverseSelector,
     ISelector nullSelector)
 {
     _nullSelector = nullSelector;
     _inverseSelector = inverseSelector;
     _rangeSelector = rangeSelector;
 }
开发者ID:e82eric,项目名称:Prompts,代码行数:9,代码来源:MultiSelector.cs

示例7: SelectDocumentForList

 public IList<string> SelectDocumentForList(ISelector selector)
 {
     var elementSelector = selector as IElementSelector;
     if (elementSelector != null)
     {
         return elementSelector.SelectList(Document);
     }
     return selector?.SelectList(GetFirstSourceText());
 }
开发者ID:hwpayg,项目名称:DotnetSpider,代码行数:9,代码来源:Html.cs

示例8: StandardProvider

        /// <summary>
        /// Initializes a new instance of the <see cref="StandardProvider"/> class.
        /// </summary>
        /// <param name="type">The type (or prototype) of instances the provider creates.</param>
        /// <param name="planner">The planner component.</param>
        /// <param name="selector">The selector component.</param>
        public StandardProvider(Type type, IPlanner planner, ISelector selector)
        {
            Ensure.ArgumentNotNull(type, "type");
            Ensure.ArgumentNotNull(planner, "planner");
            Ensure.ArgumentNotNull(selector, "selector");

            Type = type;
            Planner = planner;
            Selector = selector;
        }
开发者ID:stefanaus,项目名称:ninject,代码行数:16,代码来源:StandardProvider.cs

示例9: FilterBy

        /// <summary>
        /// 使用选择器从元素集中筛选出符合选择器要求的元素
        /// </summary>
        /// <param name="source">源元素集</param>
        /// <param name="selector">选择器</param>
        /// <returns>筛选结果</returns>
        public static IEnumerable<IHtmlElement> FilterBy( this IEnumerable<IHtmlElement> source, ISelector selector )
        {
            if ( source == null )
            return null;

              if ( selector == null )
            return source;

              return source.Where( selector.IsEligible );
        }
开发者ID:kissstudio,项目名称:Topawes5,代码行数:16,代码来源:SelectorExtensions.cs

示例10: CssCasecadingSelector

        /// <summary>
        /// 创建 CSS 层叠选择器对象
        /// </summary>
        /// <param name="relativeSelector">关系选择器</param>
        /// <param name="lastSelector">附加的最后一个选择器</param>
        public CssCasecadingSelector( CssRelativeSelector relativeSelector, ISelector lastSelector )
        {
            if ( relativeSelector == null )
            throw new ArgumentNullException( "relativeSelector" );

              if ( lastSelector == null )
            throw new ArgumentNullException( "lastSelector" );

              RelativeSelector = relativeSelector;
              LastSelector = lastSelector;
        }
开发者ID:kissstudio,项目名称:Topawes5,代码行数:16,代码来源:CssCasecadingSelector.cs

示例11: ConcludeSelector

 public void ConcludeSelector(ISelector selector)
 {
     if (!IsReady)
     {
         _selectors.Add(new CombinatorSelector
         {
             Selector = selector,
             Transform = null,
             Delimiter = null
         });
         IsReady = true;
     }
 }
开发者ID:fjwuyongzhi,项目名称:AngleSharp,代码行数:13,代码来源:ComplexSelector.cs

示例12: GeneticAlgorithm

        public GeneticAlgorithm(IRandom rand, Population candidates, Func<IOrganism, double> fitnessFunction, ISelector selector, IMutator mutator, ICrossover crossLinker, double elitismProportion, int maximumGenerations)
        {
            this.rand = rand;
            this.candidates = candidates;
            this.fitnessFunction = fitnessFunction;
            this.selector = selector;
            this.mutator = mutator;
            this.crossLinker = crossLinker;
            this.elitismProportion = elitismProportion;
            this._generationCount = 0;
            this.generationInformation = new Dictionary<int, double>();
            this.initialCount = candidates.Count;
            this.maximumGenerations = maximumGenerations;

            this.candidates.CalculateFitnesses(this.fitnessFunction);
        }
开发者ID:WalksHimself,项目名称:GeneticAlgorithms,代码行数:16,代码来源:GeneticAlgorithm.cs

示例13: Create

    /// <summary>
    /// 创建层叠选择器实例
    /// </summary>
    /// <param name="leftSelector">左选择器</param>
    /// <param name="combinator">结合符</param>
    /// <param name="rightSelector">右选择器</param>
    public static CssCasecadingSelector Create( ISelector leftSelector, char combinator, ISelector rightSelector )
    {
      if ( leftSelector == null )
        throw new ArgumentNullException( "leftSelector" );

      if ( rightSelector == null )
        throw new ArgumentNullException( "rightSelector" );


      var relativeSelctor = CreateRelativeSelector( leftSelector, combinator );
      var casecadingSelector = rightSelector as CssCasecadingSelector;

      if ( casecadingSelector != null )
        return Combine( relativeSelctor, casecadingSelector );

      return new CssCasecadingSelector( relativeSelctor, rightSelector );
    }
开发者ID:ajayumi,项目名称:Jumony,代码行数:23,代码来源:CssCasecadingSelector.cs

示例14: RunProcessing

 private void RunProcessing()
 {
     try
     {
         int delay = config.HostRequestDelayMilliseconds();
         selector = CallSelectorFactory.createISelector(config);
         selector.setIErrorHandler(errorHandler);
         threadStarted.Set();
         while (!stopThread.WaitOne(delay))
         {
             if (false == selector.Run())
                 break;
         }
         lock (lockLog)
         {
             serviceEventLog.WriteEntry("Processing finished.");
         }
     }
     catch (ThreadAbortException) {/*ignore*/}
 }
开发者ID:wortjanin,项目名称:CallSelector,代码行数:20,代码来源:CallSelectorService.cs

示例15: Deselect

 public void Deselect(ISelector selector)
 {
     if (selectors.ContainsKey(selector))
     {
         Border b = selectors[selector] as Border;
         if (Content == b)
         {
             object c = b.Child;
             Content = null;
             b.Child = null;
             Content = c;
         }
         else if (b.Parent is Border)
         {
             UIElement uie = b.Child;
             b.Child = null;
             Border parent = b.Parent as Border;
             parent.Child = null;
             parent.Child = uie;
         }
         selectors.Remove(selector);
     }
 }
开发者ID:hunpody,项目名称:psimulex,代码行数:23,代码来源:BorderedGraphics.cs


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