本文整理汇总了C#中Smuxi.Engine.ChatModel类的典型用法代码示例。如果您正苦于以下问题:C# ChatModel类的具体用法?C# ChatModel怎么用?C# ChatModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChatModel类属于Smuxi.Engine命名空间,在下文中一共展示了ChatModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChatView
public ChatView(ChatModel chat)
{
Trace.Call(chat);
_ChatModel = chat;
_Name = _ChatModel.Name;
ID = _ChatModel.ID;
Name = _Name;
MessageTextView tv = new MessageTextView();
_EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
tv.ShowTimestamps = true;
tv.ShowMarkerline = true;
tv.Editable = false;
tv.CursorVisible = true;
tv.WrapMode = Gtk.WrapMode.Char;
tv.MessageAdded += OnMessageTextViewMessageAdded;
tv.MessageHighlighted += OnMessageTextViewMessageHighlighted;
tv.PopulatePopup += OnMessageTextViewPopulatePopup;
_OutputMessageTextView = tv;
Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
//sw.HscrollbarPolicy = Gtk.PolicyType.Never;
sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
sw.VscrollbarPolicy = Gtk.PolicyType.Always;
sw.ShadowType = Gtk.ShadowType.In;
sw.Add(_OutputMessageTextView);
_OutputScrolledWindow = sw;
// popup menu
_TabMenu = new Gtk.Menu();
Gtk.ImageMenuItem close_item = new Gtk.ImageMenuItem(Gtk.Stock.Close, null);
close_item.Activated += new EventHandler(OnTabMenuCloseActivated);
_TabMenu.Append(close_item);
//FocusChild = _OutputTextView;
//CanFocus = false;
_TabLabel = new Gtk.Label();
_TabLabel.Text = _Name;
_TabHBox = new Gtk.HBox();
_TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
_TabHBox.PackEnd(_TabLabel, false, false, 0);
_TabHBox.ShowAll();
_TabEventBox = new Gtk.EventBox();
_TabEventBox.VisibleWindow = false;
_TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
_TabEventBox.Add(_TabHBox);
_TabEventBox.ShowAll();
_ThemeSettings = new ThemeSettings();
// OPT-TODO: this should use a TaskStack instead of TaskQueue
_LastSeenHighlightQueue = new TaskQueue("LastSeenHighlightQueue("+_Name+")");
_LastSeenHighlightQueue.AbortedEvent += OnLastSeenHighlightQueueAbortedEvent;
_LastSeenHighlightQueue.ExceptionEvent += OnLastSeenHighlightQueueExceptionEvent;
}
示例2: AddChat
public void AddChat(ChatModel page)
{
Trace.Call(page);
Console.WriteLine("New page: "+page.Name+ " type: "+page.ChatType);
Frontend.ChangeActiveChat(page);
}
示例3: AddChat
public override void AddChat(ChatModel chat)
{
ChatView chatView = (ChatView) CreateChatView(chat);
chatView.MainWindow = _MainWindow;
_ChatViews.Add(chat, chatView);
_ActiveChat = chatView;
}
示例4: ProtocolChatView
public ProtocolChatView(ChatModel chat)
: base(chat)
{
Trace.Call(chat);
Add(OutputScrolledWindow);
ShowAll();
}
示例5: ChatView
public ChatView(ChatModel chat, MainWindow window)
{
Trace.Call(chat, window);
if (chat == null) {
throw new ArgumentNullException("chat");
}
if (window == null) {
throw new ArgumentNullException("window");
}
ChatModel = chat;
f_MainWindow = window;
f_WidgetID = f_NextID++;
f_WidgetName = "output_textview_" + f_WidgetID;
f_MainWindow.Modify("output_vbox", "append",
"{" +
"textview[" + f_WidgetName + "] " +
".expand:vh " +
".display[" + f_WidgetID + "d]:0 " +
"offset[" + f_WidgetID + "os]:0 " +
"richtext:1 " +
"style_color0_normal:fg=black " +
"style_color1_normal:fg=red " +
"style_color2_normal:fg=green " +
"style_color3_normal:fg=yellow " +
"style_color4_normal:fg=blue " +
"style_color5_normal:fg=magenta " +
"style_color6_normal:fg=cyan " +
"style_color7_normal:fg=white " +
"style_color8_normal:fg=black,attr=bold " +
"style_color9_normal:fg=red,attr=bold " +
"style_color10_normal:fg=green,attr=bold " +
"style_color11_normal:fg=yellow,attr=bold " +
"style_color12_normal:fg=blue,attr=bold " +
"style_color13_normal:fg=magenta,attr=bold " +
"style_color14_normal:fg=cyan,attr=bold " +
"style_color15_normal:fg=white,attr=bold " +
"style_url_normal:attr=underline " +
"style_u_normal:attr=underline " +
"style_b_normal:attr=bold " +
"style_i_normal:attr=standout " +
"}"
);
MessageTextView = new TextView(f_MainWindow, f_WidgetName);
MessageTextView.OffsetVariableName = f_WidgetID + "os";
// HACK: as the chat is not always visible we can't extract the
// heigth and width information from the textview because it simply
// returns 0 when invisible, thus we need to abuse output_vbox
MessageTextView.HeigthVariableName = "output_vbox:h";
MessageTextView.WidthVariableName = "output_vbox:w";
MessageTextView.AutoLineWrap = true;
Participants = new List<PersonModel>();
}
示例6: SessionChatView
public SessionChatView(ChatModel chat)
: base(chat)
{
Trace.Call(chat);
OutputMessageTextView.ShowMarkerline = false;
OutputMessageTextView.ShowTimestamps = false;
Add(OutputScrolledWindow);
}
示例7: ChatViewAddedEventArgs
public ChatViewAddedEventArgs(ChatModel chatModel, string chatId,
ChatType chatType, int chatPosition,
Type protocolManagerType)
{
ChatModel = chatModel;
ChatID = chatId;
ChatType = chatType;
ChatPosition = chatPosition;
ProtocolManagerType = protocolManagerType;
}
示例8: AddChat
public void AddChat(ChatModel chat)
{
TraceRemotingCall(chat);
try {
_ChatViewManager.AddChat(chat);
} catch (Exception ex) {
Frontend.ShowException(ex);
}
}
示例9: ChatView
protected ChatView(ChatModel chat)
{
_ChatModel = chat;
InitializeComponent();
Name = chat.Name;
Text = chat.Name;
_OutputTextView.SelectionChanged += new EventHandler(OutputSelectionChanged);
}
示例10: AddChat
public void AddChat(ChatModel chat)
{
Trace.Call(chat);
try {
_ChatViewManager.AddChat(chat);
} catch (Exception ex) {
#if LOG4NET
_Logger.Fatal(ex);
#endif
}
}
示例11: SessionHookCommand
public SessionHookCommand(Session session,
ChatModel chat,
string commandCharacter)
{
if (session == null) {
throw new ArgumentNullException("session");
}
Session = session;
Chat = chat;
CommandCharacter = commandCharacter;
CommandName = "Session.Command";
}
示例12: ProtocolChatView
public ProtocolChatView(ChatModel chat)
: base(chat)
{
Trace.Call(chat);
var tabImage = new Gtk.Image(IconPixbuf);
TabHBox.PackStart(tabImage, false, false, 2);
TabHBox.ShowAll();
Add(OutputScrolledWindow);
ShowAll();
}
示例13: AddMessageToChat
public void AddMessageToChat(ChatModel chat, MessageModel msg)
{
Trace.Call(chat, msg);
ChatView chatView = _ChatViewManager.GetChat(chat);
#if LOG4NET
if (chatView == null) {
_Logger.Fatal(String.Format("AddMessageToChat(): _ChatViewManager.GetChat(chat) chat.Name: {0} returned null!", chat.Name));
return;
}
#endif
chatView.AddMessage(msg);
}
示例14: SessionChatView
public SessionChatView(ChatModel chat)
: base(chat)
{
Trace.Call(chat);
OutputMessageTextView.ShowMarkerline = false;
var tabImage = new Gtk.Image(IconPixbuf);
TabHBox.PackStart(tabImage, false, false, 2);
TabHBox.ShowAll();
Add(OutputScrolledWindow);
}
示例15: ProtocolManagerHookCommand
public ProtocolManagerHookCommand(ProtocolManagerBase protocolManager,
ChatModel chat,
string commandCharacter)
{
if (protocolManager == null) {
throw new ArgumentNullException("protocolManager");
}
ProtocolManager = protocolManager;
Chat = chat;
CommandCharacter = commandCharacter;
CommandName = "ProtocolManager.Command";
}