当前位置: 首页>>代码示例>>C#>>正文


C# Engine.GroupChatModel类代码示例

本文整理汇总了C#中Smuxi.Engine.GroupChatModel的典型用法代码示例。如果您正苦于以下问题:C# GroupChatModel类的具体用法?C# GroupChatModel怎么用?C# GroupChatModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GroupChatModel类属于Smuxi.Engine命名空间,在下文中一共展示了GroupChatModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TwitterSearchStream

        public TwitterSearchStream(TwitterProtocolManager protocolManager,
                                   GroupChatModel chat, string keyword,
                                   OAuthTokens tokens, WebProxy proxy)
        {
            if (protocolManager == null) {
                throw new ArgumentNullException("protocolManager");
            }
            if (chat == null) {
                throw new ArgumentNullException("chat");
            }
            if (keyword == null) {
                throw new ArgumentNullException("keyword");
            }
            if (tokens == null) {
                throw new ArgumentNullException("tokens");
            }

            ProtocolManager = protocolManager;
            Session = protocolManager.Session;
            Chat = chat;

            var options = new StreamOptions();
            options.Track.Add(keyword);

            Stream = new TwitterStream(tokens, null, options);
            Stream.Proxy = proxy;
            Stream.StartPublicStream(OnStreamStopped, OnStatusCreated, OnStatusDeleted, OnEvent);

            MessageRateLimiter = new RateLimiter(5, TimeSpan.FromSeconds(5));
        }
开发者ID:pacificIT,项目名称:smuxi,代码行数:30,代码来源:TwitterSearchStream.cs

示例2: CampfireEventStream

 public CampfireEventStream(GroupChatModel chat, Uri baseuri, NetworkCredential cred)
 {
     this.Chat = chat;
     this.Cred = cred;
     this.Host = Host;
     this.BaseUri = baseuri;
     this.LastMessage = 0;
 }
开发者ID:glwu,项目名称:smuxi,代码行数:8,代码来源:CampfireEventStream.cs

示例3: IrcGroupChatView

        public IrcGroupChatView(GroupChatModel groupChat)
            : base(groupChat)
        {
            Trace.Call(groupChat);

            if (PersonTreeView != null) {
                Gtk.CellRendererText cellr = new Gtk.CellRendererText();
                // HACK: for some reason GTK is giving the space of 2 chars which
                // we workaround using a char width of 0
                cellr.WidthChars = 0;
                Gtk.TreeViewColumn column = new Gtk.TreeViewColumn(String.Empty, cellr);
                column.Spacing = 0;
                column.SortIndicator = false;
                column.Sizing = Gtk.TreeViewColumnSizing.GrowOnly;
                column.SetCellDataFunc(cellr, new Gtk.TreeCellDataFunc(_RenderIrcGroupPersonMode));

                PersonTreeView.AppendColumn(column);
                PersonTreeView.MoveColumnAfter(IdentityNameColumn, column);
            }
        }
开发者ID:oli-obk,项目名称:smuxi,代码行数:20,代码来源:IrcGroupChatView.cs

示例4: IsFilteredMessage

        public void IsFilteredMessage()
        {
            var chat = new GroupChatModel("testchat", "Test Chat", Protocol);
            Assert.IsFalse(Session.IsFilteredMessage(chat, "foobar", MessageType.Normal));

            var filters = new List<FilterModel>(Session.Filters);
            filters.Add(
                new FilterModel() {
                    NetworkID = "TESTnet",
                    MessagePattern = "/^filter me$/"
                }
            );
            filters.Add(
                new FilterModel() {
                    NetworkID = "OTHERnet"
                }
            );
            Session.Filters = filters;
            Assert.IsTrue(Session.IsFilteredMessage(chat, "filter me", MessageType.Normal));
            Assert.IsFalse(Session.IsFilteredMessage(chat, "do not filter me", MessageType.Normal));
        }
开发者ID:meebey,项目名称:smuxi,代码行数:21,代码来源:SessionTests.cs

示例5: FindGroupChats

 public override IList<GroupChatModel> FindGroupChats(GroupChatModel filter)
 {
     throw new NotImplementedException();
 }
开发者ID:RoninBG,项目名称:smuxi,代码行数:4,代码来源:OscarProtocolManager.cs

示例6: FindGroupChats

        public override IList<GroupChatModel> FindGroupChats(GroupChatModel filter)
        {
            Trace.Call(filter);

            RefreshRooms();
            string searchPattern = null;
            if (filter == null || String.IsNullOrEmpty(filter.Name)) {
                // full channel list
            } else {
                if (!filter.Name.StartsWith("*") && !filter.Name.EndsWith("*")) {
                    searchPattern = String.Format("*{0}*", filter.Name);
                } else {
                    searchPattern = filter.Name;
                }
            }

            List<GroupChatModel> chats = new List<GroupChatModel>(Rooms.Count());
            IEnumerable<Room> matching;

            matching = searchPattern == null ? Rooms :
                Rooms.Where(r => Pattern.IsMatch(r.Name, searchPattern));

            foreach (var room in matching) {
                GroupChatModel chat = new GroupChatModel(room.Id.ToString(), room.Name, null);
                var users = Client.Get<RoomResponse>(String.Format("/room/{0}.json", chat.ID)).Room.Users;

                /* Don't waste this data */
                lock (Users) {
                    foreach (var user in users) {
                        if (!Users.ContainsKey(user.Id))
                            Users[user.Id] = CreatePerson(user);
                    }
                }

                chat.PersonCount = users.Length;

                chat.Topic = CreateMessageBuilder().AppendMessage(room.Topic).ToMessage();
                lock (chat) {
                    chats.Add(chat);
                }
            }

            return chats;
        }
开发者ID:glwu,项目名称:smuxi,代码行数:44,代码来源:CampfireProtocolManager.cs

示例7: CommandJoin

        public void CommandJoin(CommandModel cmd)
        {
            Trace.Call(cmd);

            RefreshRooms();

            /*
             * cmd.DataArray is split at SP, but that's an allowed character
             * for Campfire. Instead of relying on that, we need to remove the "/join "
             * part and then split on ','
             */
            var chans = cmd.Parameter.Split(',');
            var list = Rooms.Where(r => chans.Any(r.Name.Equals));

            foreach(Room room in list) {
                var chat = new GroupChatModel(room.Id.ToString(), room.Name, null);
                OpenChat(cmd.FrontendManager, chat);
            }
        }
开发者ID:glwu,项目名称:smuxi,代码行数:19,代码来源:CampfireProtocolManager.cs

示例8: FindGroupChats

        public override IList<GroupChatModel> FindGroupChats(GroupChatModel filter)
        {
            Trace.Call(filter);

            var list = new List<GroupChatModel>();
            if (ContactChat == null) {
                list.Add(new GroupChatModel("Contacts", "Contacts", this));
            }
            return list;
        }
开发者ID:oli-obk,项目名称:smuxi,代码行数:10,代码来源:XmppProtocolManager.cs

示例9: UpdatePersonInGroupChat

        public void UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson)
        {
            Trace.Call(groupChat, oldPerson, newPerson);

            try {
                var chatView = _ChatViewManager.GetChat(groupChat);
                if (chatView == null) {
            #if LOG4NET
                    _Logger.Fatal(String.Format("UpdatePersonInGroupChat(): _ChatViewManager.GetChat(groupChat) groupChat.Name: {0} returned null!", groupChat.Name));
            #endif
                    return;
                }

                lock (chatView.Participants) {
                    chatView.Participants.Remove(oldPerson);
                    chatView.Participants.Add(newPerson);
                }
            } catch (Exception ex) {
            #if LOG4NET
                _Logger.Fatal(ex);
            #endif
            }
        }
开发者ID:pacificIT,项目名称:smuxi,代码行数:23,代码来源:StflUI.cs

示例10: UpdateTopicInGroupChat

        public void UpdateTopicInGroupChat(GroupChatModel ecpage, string topic)
        {
            TraceRemotingCall(ecpage, topic);

            MethodBase mb = Trace.GetMethodBase();
            _Dispatcher.Invoke(DispatcherPriority.Normal,new MethodInvoker(delegate {
                TraceRemotingCall(mb, ecpage, topic);

                /*
                GroupChatView cpage = (GroupChatView)Frontend.MainWindow.Notebook.GetChat(ecpage);
                if (cpage.TopicEntry != null) {
                    cpage.TopicEntry.Text = topic;
                }
                */
            }));
        }
开发者ID:pacificIT,项目名称:smuxi,代码行数:16,代码来源:WpfUI.cs

示例11: RemovePersonFromGroupChat

 public void RemovePersonFromGroupChat(GroupChatModel cpage, PersonModel user)
 {
     Trace.Call(cpage, user);
 }
开发者ID:RoninBG,项目名称:smuxi,代码行数:4,代码来源:TestUI.cs

示例12: OnResponse

        protected override void OnResponse(Gtk.ResponseType responseType)
        {
            Trace.Call(responseType);

            switch (responseType) {
                case Gtk.ResponseType.Ok:
                    f_GroupChatModel = GetCurrentGroupChat();
                    break;
                case Gtk.ResponseType.Cancel:
                    CancelFindThread();
                    break;
            }

            base.OnResponse(responseType);
        }
开发者ID:carlosmn,项目名称:smuxi,代码行数:15,代码来源:FindGroupChatDialog.cs

示例13: OnFindButtonClicked

        protected virtual void OnFindButtonClicked(object sender, System.EventArgs e)
        {
            Trace.Call(sender, e);

            try {
                string nameFilter = f_NameEntry.Text.Trim();
                if (String.IsNullOrEmpty(nameFilter)) {
                    Gtk.MessageDialog md = new Gtk.MessageDialog(
                        this,
                        Gtk.DialogFlags.Modal,
                        Gtk.MessageType.Warning,
                        Gtk.ButtonsType.YesNo,
                        _("Searching for group chats without a filter is not " +
                          "recommended.  This may take a while, or may not " +
                          "work at all.\n" +
                          "Do you wish to continue?")
                    );
                    int result = md.Run();
                    md.Destroy();
                    if (result != (int) Gtk.ResponseType.Yes) {
                        return;
                    }
                }

                f_ListStore.Clear();
                CancelFindThread();

                GroupChatModel filter =  new GroupChatModel(null, nameFilter, null);
                f_FindThread = new Thread(new ThreadStart(delegate {
                    try {
                        Gtk.Application.Invoke(delegate {
                            GdkWindow.Cursor = new Gdk.Cursor(Gdk.CursorType.Watch);
                        });

                        IList<GroupChatModel> chats = f_ProtocolManager.FindGroupChats(filter);

                        Gtk.Application.Invoke(delegate {
                            Gdk.Color bgColor = f_TreeView.Style.Background(Gtk.StateType.Normal);
                            foreach (GroupChatModel chat in chats) {
                                f_ListStore.AppendValues(
                                    chat,
                                    chat.PersonCount,
                                    chat.Name,
                                    PangoTools.ToMarkup(chat.Topic, bgColor)
                                );
                            }
                        });
                    } catch (ThreadAbortException ex) {
            #if LOG4NET
                        f_Logger.Debug("FindThread aborted");
            #endif
                        Thread.ResetAbort();
                    } catch (Exception ex) {
                        Frontend.ShowError(this, _("Error while fetching the list of group chats from the server."), ex);
                    } finally {
                        Gtk.Application.Invoke(delegate {
                            // if the dialog is gone the GdkWindow might be destroyed already
                            if (GdkWindow != null) {
                                GdkWindow.Cursor = null;
                            }
                        });
                    }
                }));
                f_FindThread.IsBackground = true;
                f_FindThread.Start();
            } catch (Exception ex) {
                Frontend.ShowException(ex);
            }
        }
开发者ID:carlosmn,项目名称:smuxi,代码行数:69,代码来源:FindGroupChatDialog.cs

示例14: _UpdateTopicInGroupChat

 private void _UpdateTopicInGroupChat(GroupChatModel groupChat, MessageModel topic)
 {
     f_TaskQueue.Queue(delegate {
         _UI.UpdateTopicInGroupChat(groupChat, topic);
     });
 }
开发者ID:tuukka,项目名称:smuxi,代码行数:6,代码来源:FrontendManager.cs

示例15: _UpdatePersonInGroupChat

 private void _UpdatePersonInGroupChat(GroupChatModel groupChat, PersonModel oldPerson, PersonModel newPerson)
 {
     f_TaskQueue.Queue(delegate {
         _UI.UpdatePersonInGroupChat(groupChat, oldPerson, newPerson);
     });
 }
开发者ID:tuukka,项目名称:smuxi,代码行数:6,代码来源:FrontendManager.cs


注:本文中的Smuxi.Engine.GroupChatModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。