Beispiel #1
0
 /// <summary>
 /// Gets an environment with given name, if one exists.
 /// </summary>
 /// <param name="name">Name of the environment.</param>
 /// <returns>Matching environment if found.</returns>
 public static IRunningEnvironment?Get(string name) =>
 AllEnvironments.Find(c =>
                      c.Name.Equals(name, StringComparison.Ordinal));
Beispiel #2
0
 /// <summary>
 /// Checks if the environment exists with given name.
 /// </summary>
 /// <param name="name">Name of the environment.</param>
 /// <returns>True if exists.</returns>
 public static bool Exists(string name) =>
 AllEnvironments.Exists(c =>
                        c.Name.Equals(name, StringComparison.Ordinal));
Beispiel #3
0
 /// <summary>
 /// The callback. Pass this wherever a configuration callback is required.
 /// </summary>
 /// <param name="buildEnvironment"></param>
 public void Callback(IPipelineBuilderEnvironment buildEnvironment)
 {
     ++CallCount;
     AllEnvironments.Add(buildEnvironment);
     Action?.Invoke(buildEnvironment);
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RunningEnvironment"/> class.
 /// This is needed for the smart enumerations pattern.
 /// </summary>
 /// <param name="order">Order number of the environment.</param>
 /// <param name="name">Name of the environment.</param>
 private RunningEnvironment(int order, string name)
 {
     Order = order;
     Name  = name;
     AllEnvironments.Add(this);
 }
 public EnvironmentType(string name)
 {
     Name = name;
     AllEnvironments.Add(this);
 }