Esempio n. 1
0
        public void Test5()
        {
            var term = CreateWpfTerminalControl(out var w);

            w.ShowActivated = true;

            _terminal = term;
            var wClosed = false;

            w.Closed += (sender, args) => { wClosed = true; };
            w.Loaded += (sender, args) =>
            {
                var xx   = new TerminalWriter(term);
                var file = new StreamReader(@"C:\temp\Program2.cs");
                try
                {
                    while (file.EndOfStream == false)
                    {
                        var s = file.ReadLine();
                        xx.WriteLine(s);
                        DoEvents();
                    }
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(xx._written);
                    throw;
                }
            };
            w.ShowDialog();
        }
Esempio n. 2
0
        public void Test4()
        {
            var term = CreateWpfTerminalControl(out var w);

            w.ShowActivated = true;

            _terminal = term;
            var wClosed = false;

            w.Closed  += (sender, args) => { wClosed = true; };
            w.KeyDown += (sender, args) =>
            {
                var xx   = new TerminalWriter(term);
                var file = new StreamReader(@"C:\data\logs\client2\12308.json");
                try
                {
                    while (file.EndOfStream == false)
                    {
                        var s = file.ReadLine();
                        xx.WriteLine(s);
                        DoEvents();
                    }
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(xx._written);
                    throw;
                }
            };
            DoShowWindow(w);
        }