public static Message GetMessage(dynamic data) { string Sender = data.user; string Msg = data.msg.msg; string StrRole = data.role; Message.Role Role = ParseRole(StrRole); return(new Message(Sender, Role, Msg, DateTime.Now)); }
public static Message.Role ParseRole(string Role) { Message.Role EnumRole = Message.Role.GUEST; switch (Role) { case "m": EnumRole = Message.Role.MEMBER;; break; case "o": EnumRole = Message.Role.OWNER; break; default: EnumRole = Message.Role.GUEST; break; } return(EnumRole); }
public static void ParseAssign(dynamic data) { string StrRole = data.role; SelfRole = ParseRole(StrRole); }