GetCmdName() public static method

public static GetCmdName ( System type ) : string
type System
return string
Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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>();
        }