public static bool TryParse(string value, out SecurityEventOutcome result) { result = default(SecurityEventOutcome); if( value=="0") result = SecurityEventOutcome.N0; else if( value=="4") result = SecurityEventOutcome.N4; else if( value=="8") result = SecurityEventOutcome.N8; else if( value=="12") result = SecurityEventOutcome.N12; else return false; return true; }
public static string ToString(SecurityEventOutcome value) { if( value==SecurityEventOutcome.N0 ) return "0"; else if( value==SecurityEventOutcome.N4 ) return "4"; else if( value==SecurityEventOutcome.N8 ) return "8"; else if( value==SecurityEventOutcome.N12 ) return "12"; else throw new ArgumentException("Unrecognized SecurityEventOutcome value: " + value.ToString()); }