コード例 #1
0
        private void ServerWrapper_ConnectSucceeded(object sender, EventArgs ev)
        {
            StopIdentServer( );

            ConsolePanel.Dispatcher.BeginInvoke((Action)(() => {
                var serverWrapper = (ServerWrapper)sender;
                TabItem tab;
                IIrcPanel panel;

                if (!AddPanel("Server" + _serverPanelSerial++, _currentServer.ServerConfiguration.HostName, "ServerPanel", out tab, out panel))
                {
                    return;
                }
                var serverPanel = (ServerPanel)panel;
                serverPanel.ServerWrapper = serverWrapper;
                serverPanel.NetworkWrapper = serverWrapper.NetworkWrapper;
                _panels.Add(panel);
                tab.Focus( );
                ConsolePanel.ScrollbackManager.AddLine(ScrollbackParagraphMaker.Make(
                                                           "Server ",
                                                           FindResource("ServerNameStyle"),
                                                           _currentServer.Name,
                                                           ": Connected."
                                                           ));
            }));
        }
コード例 #2
0
 private void _ShowMotdMissing( )
 {
     _scrollbackManager.AddLine(ScrollbackParagraphMaker.Make(
                                    "Server's ",
                                    FontStyles.Italic,
                                    "Message of the Day",
                                    " file is missing."
                                    ));
 }
コード例 #3
0
 private void Server_ServerNotice(object sender, ServerNoticeEventArgs ev)
 {
     Debug.Print("ServerPanel.Server_ServerNotice: origin='{0}' text='{1}'", ev.Origin, ev.Text);
     Dispatcher.BeginInvoke((Action)(() => _scrollbackManager.AddLine(ScrollbackParagraphMaker.Make(
                                                                          "-",
                                                                          FindResource("ServerNameStyle"),
                                                                          ev.Origin,
                                                                          "- ",
                                                                          ev.Text
                                                                          ))));
 }
コード例 #4
0
        private void Server_Unknown(object sender, MessageEventArgs ev)
        {
            Debug.Print("ServerPanel.Server_Unknown");

            Message m = ev.Message;

            Dispatcher.BeginInvoke((Action)(() => {
                var style = FindResource("RawMessageStyle") as Style;
                var para = ScrollbackParagraphMaker.Make(m.ToString( ));
                para.Style = style;
                _scrollbackManager.AddLine(para);
            }));
        }
コード例 #5
0
        private void _ShowMotdContent(ICollection <string> lines)
        {
            _scrollbackManager.AddLine(ScrollbackParagraphMaker.Make(
                                           "Server's ",
                                           FontStyles.Italic,
                                           "Message of the Day",
                                           ":"
                                           ));

            var para = ScrollbackParagraphMaker.Make(string.Join("\r\n", lines.Select(_ => _.StartsWith("- ") ? _.Substring(2) : _)));

            para.Style = FindResource("MessageOfTheDayStyle") as Style;
            _scrollbackManager.AddLine(para);
        }
コード例 #6
0
        // IRC event handlers

        private void Server_MotdComplete(object sender, MotdCompleteEventArgs ev)
        {
            Debug.Print("ServerPanel.Server_MotdComplete");

            Dispatcher.BeginInvoke((Action)(() => {
                _scrollbackManager.AddLine(ScrollbackParagraphMaker.Make(
                                               "Server's ",
                                               FontStyles.Italic,
                                               "Message of the Day",
                                               ":"
                                               ));

                var style = FindResource("MessageOfTheDayStyle") as Style;
                var para = ScrollbackParagraphMaker.Make(string.Join("\r\n", ev.Lines.Select(_ => _.StartsWith("- ") ? _.Substring(2) : _)));
                para.Style = style;
                _scrollbackManager.AddLine(para);
            }));
        }
コード例 #7
0
 private void NetworkWrapper_ConnectSucceeded(object sender, EventArgs ev)
 {
     ConsolePanel.Dispatcher.BeginInvoke((Action)(() => ConsolePanel.ScrollbackManager.AddLine(ScrollbackParagraphMaker.Make(
                                                                                                   "Network ",
                                                                                                   FindResource("NetworkNameStyle"),
                                                                                                   _currentNetwork.Name,
                                                                                                   ": Connected to server ",
                                                                                                   FindResource("ServerNameStyle"),
                                                                                                   _currentServer.Name,
                                                                                                   "."
                                                                                                   ))));
 }
コード例 #8
0
 private void Server_Registered(object sender, RegisteredEventArgs ev)
 {
     Debug.Print("ServerPanel.Server_Registered");
     Dispatcher.BeginInvoke((Action)(() => _scrollbackManager.AddLine(ScrollbackParagraphMaker.Make("Registered."))));
 }