Ejemplo n.º 1
0
 /// <summary>
 /// Writes out the <see cref="LoggingPolicies"/> which are set individually to the pipeline.
 /// </summary>
 /// <param name="modes">The <see cref="LoggingPolicies"/> which are set.</param>
 protected void WriteEnumValues(LoggingPolicies modes)
 {
     foreach (LoggingPolicies mode in Enum.GetValues(typeof(LoggingPolicies)))
     {
         if (0 != (mode & modes) && LoggingPolicies.All != mode)
         {
             // Return the values as strings so they can be sorted and easily used with -contains.
             base.WriteObject(mode.ToString());
         }
     }
 }
Ejemplo n.º 2
0
 private static bool TryParse(string value, out LoggingPolicies mode)
 {
     try
     {
         mode = (LoggingPolicies)Enum.Parse(typeof(LoggingPolicies), value, true);
         return(true);
     }
     catch
     {
         mode = 0;
         return(false);
     }
 }
Ejemplo n.º 3
0
 private static bool TryParse(string value, out LoggingPolicies mode)
 {
     try
     {
         mode = (LoggingPolicies)Enum.Parse(typeof(LoggingPolicies), value, true);
         return true;
     }
     catch
     {
         mode = 0;
         return false;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Writes out the <see cref="LoggingPolicies"/> which are set individually to the pipeline.
 /// </summary>
 /// <param name="modes">The <see cref="LoggingPolicies"/> which are set.</param>
 protected void WriteEnumValues(LoggingPolicies modes)
 {
     foreach (LoggingPolicies mode in Enum.GetValues(typeof(LoggingPolicies)))
     {
         if (0 != (mode & modes) && LoggingPolicies.All != mode)
         {
             // Return the values as strings so they can be sorted and easily used with -contains.
             base.WriteObject(mode.ToString());
         }
     }
 }