Exemple #1
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);
            }));
        }
        public ConsolePanel( )
        {
            InitializeComponent( );

            PanelImpl = new PanelImpl {
                IrcPanel         = this,
                ScrollViewer     = ScrollViewer,
                ScrollbackViewer = ScrollbackViewer,
                InputBar         = InputBar,
                Dispatcher       = Dispatcher,
            };
            PanelImpl.InitializeComponent( );

            ScrollbackManager.AddLine("Welcome to ZiveIRC.");
        }
        public ConsolePanel( )
        {
            InitializeComponent( );

            _scrollActions = new Dictionary <ScrollAction, Action> {
                { ScrollAction.PageUp, ScrollViewer.PageUp },
                { ScrollAction.PageDown, ScrollViewer.PageDown },
                { ScrollAction.LineUp, ScrollViewer.LineUp },
                { ScrollAction.LineDown, ScrollViewer.LineDown },
                { ScrollAction.Top, ScrollViewer.ScrollToTop },
                { ScrollAction.Bottom, ScrollViewer.ScrollToBottom },
            };

            _scrollbackManager = new ScrollbackManager {
                FlowDocument = ScrollbackViewer.Document,
            };
            _scrollbackManager.AddLine("Welcome to ZiveIRC.");
        }
        public ConsolePanel( )
        {
            InitializeComponent( );

            _scrollActions = new Dictionary<ScrollAction, Action> {
                { ScrollAction.PageUp,   ScrollViewer.PageUp         },
                { ScrollAction.PageDown, ScrollViewer.PageDown       },
                { ScrollAction.LineUp,   ScrollViewer.LineUp         },
                { ScrollAction.LineDown, ScrollViewer.LineDown       },
                { ScrollAction.Top,      ScrollViewer.ScrollToTop    },
                { ScrollAction.Bottom,   ScrollViewer.ScrollToBottom },
            };

            _scrollbackManager = new ScrollbackManager {
                FlowDocument = ScrollbackViewer.Document,
            };
            _scrollbackManager.AddLine( "Welcome to ZiveIRC." );
        }
Exemple #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);
        }