예제 #1
0
 private void ConfigureSerializer()
 {
     JsConfig <RoomColors> .SerializeFn           = colors => colors.ToString().ToLower();
     JsConfig <HipchatMessageFormat> .SerializeFn = format => format.ToString().ToLower();
     JsConfig <RoomPrivacy> .SerializeFn          = p =>
     {
         var value = p.ToString().ToLowercaseUnderscore();
         return(value);
     };
     JsConfig <RoomEvent> .SerializeFn   = rmEvent => rmEvent.ToString().ToLowercaseUnderscore();
     JsConfig <GrantType> .SerializeFn   = grant => grant.ToString().ToLowercaseUnderscore();
     JsConfig <RoomEvent> .DeSerializeFn = s =>
     {
         var       pascalCase = s.ToTitleCase();
         RoomEvent e;
         RoomEvent.TryParse(s, out e);
         return(e);
     };
 }