public static GetCmdName ( System type ) : string | ||
type | System | |
return | string |
public void RegisterCreator(System.Type type) { string name = MessageCmdData.GetCmdName(type); if (name == null) { System.InvalidOperationException ex = new System.InvalidOperationException("missing CmdNameAttribute"); throw ex; } m_creators[name] = new TypeBasedCreator(type); }
public static string GetCmdName(System.Type type) { string name; if (!m_typeToCommandName.TryGetValue(type, out name)) { name = MessageCmdData.GetCmdName(type); m_typeToCommandName[type] = name; } return(name); }
public void RegisterCreator <T>() where T : new() { string name = MessageCmdData.GetCmdName(typeof(T)); if (name == null) { System.InvalidOperationException ex = new System.InvalidOperationException("missing CmdNameAttribute"); throw ex; } m_creators[name] = new TypedCreator <T>(); }