當前位置: 首頁>>代碼示例>>C#>>正文


C# ChatModel.GetType方法代碼示例

本文整理匯總了C#中Smuxi.Engine.ChatModel.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# ChatModel.GetType方法的具體用法?C# ChatModel.GetType怎麽用?C# ChatModel.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Smuxi.Engine.ChatModel的用法示例。


在下文中一共展示了ChatModel.GetType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CommandModel

        public CommandModel(FrontendManager fm, ChatModel chat, string cmdChar, string data)
        {
            Trace.Call(fm, chat == null ? "(null)" : chat.GetType().ToString(), cmdChar, data);

            _Data = data;
            _DataArray = data.Split(new char[] {' '});
            _Parameter = String.Join(" ", _DataArray, 1, _DataArray.Length - 1);
            _CommandCharacter = cmdChar;
            if (data.StartsWith(cmdChar) &&
                !data.StartsWith(cmdChar + cmdChar)) {
                _IsCommand = true;
                _Command = (_DataArray[0].Length > cmdChar.Length) ?
                                _DataArray[0].Substring(cmdChar.Length).ToLower() :
                                String.Empty;
            } else if (data.StartsWith(cmdChar + cmdChar)) {
                _Data = data.Substring(cmdChar.Length);
                _DataArray[0] = _DataArray[0].Substring(cmdChar.Length);
            }
            _FrontendManager = fm;
            _Chat = chat;
        }
開發者ID:grendello,項目名稱:smuxi,代碼行數:21,代碼來源:CommandModel.cs

示例2: CreateChatView

        protected IChatView CreateChatView(ChatModel chat,
                                           ChatType chatType,
                                           Type protocolManagerType,
                                           params object[] parameters)
        {
            Trace.Call(chat, chatType, protocolManagerType, parameters);

            Type type;
            type = _GetChatViewType(chatType, protocolManagerType);
            if (type == null) {
                type = _GetChatViewType(chatType, null);
            }

            if (type == null) {
                throw new ApplicationException("Unsupported ChatModel type: " + chat.GetType());
            }

            object[] ctorParams;
            if (parameters != null && parameters.Length > 0) {
                ctorParams = new object[parameters.Length + 1];
                ctorParams[0] = chat;
                parameters.CopyTo(ctorParams, 1);
            } else {
                ctorParams = new object[] {chat};
            }

            return (IChatView) Activator.CreateInstance(type, ctorParams);
        }
開發者ID:carlosmn,項目名稱:smuxi,代碼行數:28,代碼來源:ChatViewManagerBase.cs

示例3: CreateChatView

        protected IChatView CreateChatView(ChatModel chat)
        {
            Trace.Call(chat);

            Type type;
            type = _GetChatViewType(chat.ChatType, chat.ProtocolManager != null ?
                                                   chat.ProtocolManager.GetType() : null);
            if (type == null) {
                type = _GetChatViewType(chat.ChatType, null);
            }

            if (type == null) {
                throw new ApplicationException("Unsupported ChatModel type: " + chat.GetType());
            }

            return (IChatView) Activator.CreateInstance(type, chat);
        }
開發者ID:tuukka,項目名稱:smuxi,代碼行數:17,代碼來源:ChatViewManagerBase.cs


注:本文中的Smuxi.Engine.ChatModel.GetType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。