本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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() );
}
示例5: SelectDocument
public string SelectDocument(ISelector selector)
{
IElementSelector elementSelector = selector as IElementSelector;
if (elementSelector != null)
{
return elementSelector.Select(Document);
}
return selector?.Select(GetFirstSourceText());
}
示例6: MultiSelector
public MultiSelector(
IRangeSelector rangeSelector,
ISelector inverseSelector,
ISelector nullSelector)
{
_nullSelector = nullSelector;
_inverseSelector = inverseSelector;
_rangeSelector = rangeSelector;
}
示例7: SelectDocumentForList
public IList<string> SelectDocumentForList(ISelector selector)
{
var elementSelector = selector as IElementSelector;
if (elementSelector != null)
{
return elementSelector.SelectList(Document);
}
return selector?.SelectList(GetFirstSourceText());
}
示例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;
}
示例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 );
}
示例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;
}
示例11: ConcludeSelector
public void ConcludeSelector(ISelector selector)
{
if (!IsReady)
{
_selectors.Add(new CombinatorSelector
{
Selector = selector,
Transform = null,
Delimiter = null
});
IsReady = true;
}
}
示例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);
}
示例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 );
}
示例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*/}
}
示例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);
}
}