/// <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()); } } }
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); } }
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; } }
/// <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()); } } }