当前位置: 首页>>代码示例>>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;未经允许,请勿转载。