Pipeline Class

Summary

A utility class for specifying pipelines. Note that this is not required for pipeline creation and is typically only used when a pipeline needs to be specified outside the context of a configuration file (such as a recipe, though it's not even required for those). Instances of this class are typically assigned to read-only properties in a Wyam.Common.Configuration.Recipe class and by convention the class name should match the property name (an exception will be thrown during recipe application if not). This class also implements string conversions and operators that return the pipeline name (so it can be used as a key for the pipeline it defines). Note that once this pipeline is added to an Wyam.Common.Execution.IPipelineCollection, the actual instance probably won't be what's stored by the collection and should not be used for comparisons.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Execution
Interfaces
Base Types
  • object
Derived Types
graph TD Base0["object"]-->Type Interface0["IPipeline"]-.->Type click Interface0 "/api/Wyam.Common.Execution/IPipeline" Interface1["IModuleList"]-.->Type click Interface1 "/api/Wyam.Common.Modules/IModuleList" Interface2["IList<T>"]-.->Type Interface3["ICollection<T>"]-.->Type Interface4["IEnumerable<T>"]-.->Type Interface5["IEnumerable"]-.->Type Type["Pipeline"] class Type type-node Type-->Derived0["TagIndex"] click Derived0 "/api/Wyam.Blog.Pipelines/TagIndex" Type-->Derived1["Api"] click Derived1 "/api/Wyam.Docs.Pipelines/Api" Type-->Derived2["Code"] click Derived2 "/api/Wyam.Docs.Pipelines/Code" Type-->Derived3["RenderApi"] click Derived3 "/api/Wyam.Docs.Pipelines/RenderApi" Type-->Derived4["ApiSearchIndex"] click Derived4 "/api/Wyam.Docs.Pipelines/ApiSearchIndex" Type-->Derived5["ApiIndex"] click Derived5 "/api/Wyam.Docs.Pipelines/ApiIndex"

Syntax

public class Pipeline : IPipeline, IModuleList, IList<IModule>, ICollection<IModule>, 
    IEnumerable<IModule>, IEnumerable

Constructors

Name Summary
Pipeline() Creates a pipeline with an empty modules collection and a default name equal to the class name.
Pipeline(IEnumerable<IModule>) Creates a pipeline with the specified modules and a default name equal to the class name.
Pipeline(IModule[]) Creates a pipeline with the specified modules and a default name equal to the class name.
Pipeline(string, IEnumerable<IModule>) Creates a pipeline with the specified modules and the specified name.
Pipeline(string, IModule[]) Creates a pipeline with the specified modules and the specified name.

Properties

Name Value Summary
Count int
IsReadOnly bool
Name string
The name of the pipeline.
ProcessDocumentsOnce bool
Specifies that a given pipeline doesn't use data from other pipelines and prevents reprocessing of documents after the first pass.
this[int] IModule
this[string] IModule
Gets the module with the specified name.

Methods

Name Value Summary
Add(IModule) void
Add(IModule[]) void
Adds modules to the list. Any null items in the sequence of modules will be discarded.
Add(string, IModule) void
Adds a module to the list with a specified name.
AsKeyValuePairs() IEnumerable<T>
Returns the list as a sequence of key-value pairs with the keys being the module names and the values being the module instances.
Clear() void
Contains(IModule) bool
Contains(string) bool
Determines if the list contains a module with the specified name.
CopyTo(IModule[], int) void
GetEnumerator() IEnumerator<T>
GetHashCode() int
IndexOf(IModule) int
IndexOf(string) int
Gets the index of the module with the specified name.
Insert(int, IModule) void
Insert(int, IModule[]) void
Inserts modules into the list. Any null items in the sequence of modules will be discarded.
Insert(int, string, IModule) void
Inserts a module into the list with a specified name.
Remove(IModule) bool
Remove(string) bool
Removes a module by name.
RemoveAt(int) void
ToString() string
TryGetValue(string, IModule) bool
Attempts to get a module with the specified name.

Operators

Name Value Summary
implicit operator string(Pipeline) string

Extension Methods

Name Value Summary
AddRange<IModule>(IEnumerable<IModule>) void
Adds a range of values to a collection.
Append<Pipeline>(IModule[]) TModuleList
Appends modules.
Append<Pipeline>(string, IModule) TModuleList
Appends a named module.
GroupByMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, TElement>) IEnumerable<T>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function.
GroupByMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, TElement>, IEqualityComparer<TKey>) IEnumerable<T>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
GroupByMany<IModule, TKey>(Func<IModule, IEnumerable<TKey>>) IEnumerable<T>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys.
GroupByMany<IModule, TKey>(Func<IModule, IEnumerable<TKey>>, IEqualityComparer<TKey>) IEnumerable<T>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and compares the keys by using a specified comparer.
GroupByManyToMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, IEnumerable<TElement>>) IEnumerable<T>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function that returns a sequence of elements.
GroupByManyToMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, IEnumerable<TElement>>, IEqualityComparer<TKey>) IEnumerable<T>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function that returns a sequence of elements.
InsertAfter<Pipeline>(string, IModule[]) TModuleList
Inserts modules after the module with the specified name.
InsertAfter<Pipeline>(string, string, IModule) TModuleList
Inserts modules after the module with the specified name.
InsertAfterFirst<T>(IModule[]) IModuleList
Inserts modules after the first module in the list of the specified type.
InsertAfterFirst<T>(Predicate<T>, IModule[]) IModuleList
Inserts modules after the first module in the list of the specified type that satisfies a predicate.
InsertAfterFirst<T>(Predicate<T>, string, IModule) IModuleList
Inserts modules after the first module in the list of the specified type that satisfies a predicate.
InsertAfterFirst<T>(string, IModule) IModuleList
Inserts modules after the first module in the list of the specified type.
InsertAfterLast<T>(IModule[]) IModuleList
Inserts modules after the last module in the list of the specified type.
InsertAfterLast<T>(Predicate<T>, IModule[]) IModuleList
Inserts modules after the last module in the list of the specified type that satisfies a predicate.
InsertAfterLast<T>(Predicate<T>, string, IModule) IModuleList
Inserts modules after the last module in the list of the specified type that satisfies a predicate.
InsertAfterLast<T>(string, IModule) IModuleList
Inserts modules after the last module in the list of the specified type.
InsertBefore<Pipeline>(string, IModule[]) TModuleList
Inserts modules before the module with the specified name.
InsertBefore<Pipeline>(string, string, IModule) TModuleList
Inserts modules before the module with the specified name.
InsertBeforeFirst<T>(IModule[]) IModuleList
Inserts modules before the first module in the list of the specified type.
InsertBeforeFirst<T>(Predicate<T>, IModule[]) IModuleList
Inserts modules before the first module in the list of the specified type that satisfies a predicate.
InsertBeforeFirst<T>(Predicate<T>, string, IModule) IModuleList
Inserts modules before the first module in the list of the specified type that satisfies a predicate.
InsertBeforeFirst<T>(string, IModule) IModuleList
Inserts modules before the first module in the list of the specified type.
InsertBeforeLast<T>(IModule[]) IModuleList
Inserts modules before the last module in the list of the specified type.
InsertBeforeLast<T>(Predicate<T>, IModule[]) IModuleList
Inserts modules before the last module in the list of the specified type that satisfies a predicate.
InsertBeforeLast<T>(Predicate<T>, string, IModule) IModuleList
Inserts modules before the last module in the list of the specified type that satisfies a predicate.
InsertBeforeLast<T>(string, IModule) IModuleList
Inserts modules before the last module in the list of the specified type.
Modify<Pipeline>(int, Action<IModule>) TModuleList
Modifies an inner module list with the specified index.
Modify<Pipeline>(string, Action<IModule>) TModuleList
Modifies an inner module with the specified name.
Prepend<Pipeline>(IModule[]) TModuleList
Prepends modules.
Prepend<Pipeline>(string, IModule) TModuleList
Prepends a named module.
RemoveAll<IModule>(Func<IModule, bool>) int
Removes all items that match a predicate from a collection.
Replace<Pipeline>(int, IModule, string) TModuleList
Replaces a module at the specified index.
Replace<Pipeline>(string, IModule, string) TModuleList
Replaces a module with the specified name. The replacement module will have the same name as the module being replaced unless an alternate name is specified.
ReplaceFirst<T>(IModule, string) IModuleList
Replaces the first module in the list of the specified type.
ReplaceFirst<T>(Predicate<T>, IModule, string) IModuleList
Replaces the first module in the list of the specified type that satisfies a predicate.
ReplaceLast<T>(IModule, string) IModuleList
Replaces the last module in the list of the specified type.
ReplaceLast<T>(Predicate<T>, IModule, string) IModuleList
Replaces the last module in the list of the specified type that satisfies a predicate.
ToLookupMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, TElement>) ILookup<,>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function.
ToLookupMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, TElement>, IEqualityComparer<TKey>) ILookup<,>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
ToLookupMany<IModule, TKey>(Func<IModule, IEnumerable<TKey>>) ILookup<,>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys.
ToLookupMany<IModule, TKey>(Func<IModule, IEnumerable<TKey>>, IEqualityComparer<TKey>) ILookup<,>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and compares the keys by using a specified comparer.
ToLookupManyToMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, IEnumerable<TElement>>) ILookup<,>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function that returns a sequence of elements.
ToLookupManyToMany<IModule, TKey, TElement>(Func<IModule, IEnumerable<TKey>>, Func<IModule, IEnumerable<TElement>>, IEqualityComparer<TKey>) ILookup<,>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function that returns a sequence of elements.
WithProcessDocumentsOnce(bool) IPipeline
Specifies that a given pipeline doesn't use data from other pipelines and prevents reprocessing of documents after the first pass.
GitHub