本文整理汇总了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;
}
示例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);
}
示例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);
}