public static bool TryParse(string value, out SecurityEventObjectRole result) { result = default(SecurityEventObjectRole); if( value=="1") result = SecurityEventObjectRole.N1; else if( value=="2") result = SecurityEventObjectRole.N2; else if( value=="3") result = SecurityEventObjectRole.N3; else if( value=="4") result = SecurityEventObjectRole.N4; else if( value=="5") result = SecurityEventObjectRole.N5; else if( value=="6") result = SecurityEventObjectRole.N6; else if( value=="7") result = SecurityEventObjectRole.N7; else if( value=="8") result = SecurityEventObjectRole.N8; else if( value=="9") result = SecurityEventObjectRole.N9; else if( value=="10") result = SecurityEventObjectRole.N10; else if( value=="11") result = SecurityEventObjectRole.N11; else if( value=="12") result = SecurityEventObjectRole.N12; else if( value=="13") result = SecurityEventObjectRole.N13; else if( value=="14") result = SecurityEventObjectRole.N14; else if( value=="15") result = SecurityEventObjectRole.N15; else if( value=="16") result = SecurityEventObjectRole.N16; else if( value=="17") result = SecurityEventObjectRole.N17; else if( value=="18") result = SecurityEventObjectRole.N18; else if( value=="19") result = SecurityEventObjectRole.N19; else if( value=="20") result = SecurityEventObjectRole.N20; else if( value=="21") result = SecurityEventObjectRole.N21; else if( value=="22") result = SecurityEventObjectRole.N22; else if( value=="23") result = SecurityEventObjectRole.N23; else if( value=="24") result = SecurityEventObjectRole.N24; else return false; return true; }
public static string ToString(SecurityEventObjectRole value) { if( value==SecurityEventObjectRole.N1 ) return "1"; else if( value==SecurityEventObjectRole.N2 ) return "2"; else if( value==SecurityEventObjectRole.N3 ) return "3"; else if( value==SecurityEventObjectRole.N4 ) return "4"; else if( value==SecurityEventObjectRole.N5 ) return "5"; else if( value==SecurityEventObjectRole.N6 ) return "6"; else if( value==SecurityEventObjectRole.N7 ) return "7"; else if( value==SecurityEventObjectRole.N8 ) return "8"; else if( value==SecurityEventObjectRole.N9 ) return "9"; else if( value==SecurityEventObjectRole.N10 ) return "10"; else if( value==SecurityEventObjectRole.N11 ) return "11"; else if( value==SecurityEventObjectRole.N12 ) return "12"; else if( value==SecurityEventObjectRole.N13 ) return "13"; else if( value==SecurityEventObjectRole.N14 ) return "14"; else if( value==SecurityEventObjectRole.N15 ) return "15"; else if( value==SecurityEventObjectRole.N16 ) return "16"; else if( value==SecurityEventObjectRole.N17 ) return "17"; else if( value==SecurityEventObjectRole.N18 ) return "18"; else if( value==SecurityEventObjectRole.N19 ) return "19"; else if( value==SecurityEventObjectRole.N20 ) return "20"; else if( value==SecurityEventObjectRole.N21 ) return "21"; else if( value==SecurityEventObjectRole.N22 ) return "22"; else if( value==SecurityEventObjectRole.N23 ) return "23"; else if( value==SecurityEventObjectRole.N24 ) return "24"; else throw new ArgumentException("Unrecognized SecurityEventObjectRole value: " + value.ToString()); }