本文整理汇总了C#中DocumentConfig类的典型用法代码示例。如果您正苦于以下问题:C# DocumentConfig类的具体用法?C# DocumentConfig怎么用?C# DocumentConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DocumentConfig类属于命名空间,在下文中一共展示了DocumentConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadWorkspace
protected ReadWorkspace(DocumentConfig path)
{
if (path == null)
{
throw new ArgumentNullException(nameof(path));
}
_path = new ConfigHelper<string>(path);
}
示例2: OrderBy
public OrderBy(DocumentConfig key)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
_key = key;
}
示例3: Where
/// <summary>
/// Limits the documents passed to the child modules to those that satisfy the
/// supplied predicate. All original input documents are output without
/// modification regardless of whether they satisfy the predicate.
/// </summary>
/// <param name="predicate">A delegate that should return a <c>bool</c>.</param>
public ConcatBranch Where(DocumentConfig predicate)
{
Func<IDocument, IExecutionContext, bool> currentPredicate = _predicate;
_predicate = currentPredicate == null
? (Func<IDocument, IExecutionContext, bool>)(predicate.Invoke<bool>)
: ((x, c) => currentPredicate(x, c) && predicate.Invoke<bool>(x, c));
return this;
}
示例4: GenerateMeta
/// <summary>
/// Uses a function to determine a text template which is processed and added as metadata for each document.
/// This allows you to specify different metadata for each document depending on the input.
/// </summary>
/// <param name="key">The metadata key for the generated text.</param>
/// <param name="template">A delegate that returns the template to use.</param>
public GenerateMeta(string key, DocumentConfig template) : base(template)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
_key = key;
}
示例5: Switch
/// <summary>
/// Defines the delegate that will be invoked against each input document to get the case comparison value.
/// </summary>
/// <param name="value">A delegate that returns an object to compare cases against.</param>
public Switch(DocumentConfig value)
{
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
_value = value;
}
示例6: Documents
// This will get documents based on each input document - the result will be the aggregate of all returned documents for each input document
// The delegate should return a IEnumerable<IDocument>
public Documents(DocumentConfig documents)
{
if (documents == null)
{
throw new ArgumentNullException(nameof(documents));
}
_documentDocuments = documents;
}
示例7: ReadWorkspace
protected ReadWorkspace(DocumentConfig path)
{
if (path == null)
{
throw new ArgumentNullException(nameof(path));
}
_pathDelegate = path;
}
示例8: FileName
/// <summary>
/// Sets the metadata key <c>WriteFileName</c> to an optimized version of the return value of the delegate.
/// Also sets the metadata key <c>WritePath</c> to <c>Path.Combine(RelativeFileDir, WriteFileName)</c>.
/// </summary>
/// <param name="fileName">A delegate that should return a <c>string</c> with the filename to optimize.</param>
public FileName(DocumentConfig fileName)
{
if (fileName == null)
{
throw new ArgumentNullException(nameof(fileName));
}
_fileName = fileName;
}
示例9: Sitemap
/// <summary>
/// Creates a sitemap using the specified delegate which should return either a <c>string</c> that
/// contains the location for each input document or a <c>SitemapItem</c> instance with the location
/// and other information.
/// </summary>
/// <param name="sitemapItemOrLocation">A delegate that either returns a <c>SitemapItem</c> instance or a <c>string</c>
/// with the desired item location. If the delegate returns <c>null</c>, the input document is not added to the sitemap.</param>
/// <param name="locationFormatter">A location formatter that will be applied to the location of each input after
/// getting the value of the specified metadata key.</param>
public Sitemap(DocumentConfig sitemapItemOrLocation, Func<string, string> locationFormatter = null)
{
if (sitemapItemOrLocation == null)
{
throw new ArgumentNullException(nameof(sitemapItemOrLocation));
}
_sitemapItemOrLocation = sitemapItemOrLocation;
_locationFormatter = locationFormatter;
}
示例10: ThenBy
public OrderBy ThenBy(DocumentConfig key)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
_thenByList.Add(new ThenByEntry(key));
return this;
}
示例11: Meta
/// <summary>
/// Uses a function to determine an object to be added as metadata for each document.
/// This allows you to specify different metadata for each document depending on the input.
/// </summary>
/// <param name="key">The metadata key to set.</param>
/// <param name="metadata">A delegate that returns the object to add as metadata.</param>
public Meta(string key, DocumentConfig metadata)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
_key = key;
_metadata = new ConfigHelper<object>(metadata);
}
示例12: Meta
public Meta(string key, DocumentConfig metadata)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
_key = key;
_metadata = metadata ?? ((x, y) => null);
}
示例13: ReadFiles
/// <summary>
/// Reads all files that match the specified globbing patterns and/or absolute paths. This allows you to
/// specify different patterns and/or paths depending on the input.
/// </summary>
/// <param name="patterns">A delegate that returns one or more globbing patterns and/or absolute paths.</param>
public ReadFiles(DocumentConfig patterns)
{
if (patterns == null)
{
throw new ArgumentNullException(nameof(patterns));
}
_patternsDelegate = patterns;
}
示例14: GroupBy
public GroupBy(DocumentConfig key, params IModule[] modules)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
_key = key;
_modules = modules;
}
示例15: ReadFiles
/// <summary>
/// Reads all files that match the specified path. This allows you to specify different search paths depending on the input.
/// </summary>
/// <param name="path">A delegate that returns a <c>string</c> with the search path.</param>
public ReadFiles(DocumentConfig path)
{
if (path == null)
{
throw new ArgumentNullException(nameof(path));
}
_path = path;
}