Ejemplo n.º 1
0
 /// <summary>
 ///     Invoke the Collections plugin with a single collection definition.
 /// </summary>
 ///
 /// <example>
 ///     Only add `.md` files to a collection named `myCollection`:
 ///
 ///     ```c#
 ///         new MetalsharpProject()
 ///         .UseCollections("myCollection", file => file.Extension == ".md");
 ///     ```
 /// </example>
 ///
 /// <param name="project">
 ///     The `MetalsharpProject` on which this method will be called.
 /// </param>
 /// <param name="name">
 ///     The name of the collection to define.
 /// </param>
 /// <param name="predicate">
 ///     The predicate to match the files for the collection.
 /// </param>
 ///
 /// <returns>
 ///     Combinator; returns `this` input.
 /// </returns>
 public static MetalsharpProject UseCollections(this MetalsharpProject project, string name, Predicate <IMetalsharpFile> predicate) =>
 project.Use(new Collections(name, predicate));
Ejemplo n.º 2
0
 /// <summary>
 ///     Invoke the Branch plugin.
 /// </summary>
 ///
 /// <example>
 ///     Branch the `MetalsharpProject` twice:
 ///
 ///     ```c#
 ///         new MetalsharpProject()
 ///         // Add files
 ///         .Branch(
 ///         dir => {
 ///         // Do something with branch 1
 ///         },
 ///         dir => {
 ///         // Do something with branch 2
 ///         }
 ///         );
 ///     ```
 /// </example>
 ///
 /// <param name="project">
 ///     The `MetalsharpProject` on which this method will be called.
 /// </param>
 /// <param name="branches">
 ///     The functions to handle each of the branches.
 /// </param>
 ///
 /// <returns>
 ///     Combinator; returns `this` input.
 /// </returns>
 public static MetalsharpProject Branch(this MetalsharpProject project, params Action <MetalsharpProject>[] branches) =>
 project.Use(new Branch(branches));