/// <summary>
        /// Default TerminalSizeChanged event handler. Invoked when
        /// initial CanvasSize and RootElementRect are empty and no another
        /// TerminalSizeChanged handler is attached.
        /// </summary>
        public void OnTerminalSizeChangedDefault(object sender, TerminalSizeChangedEventArgs args)
        {
            if (!this.userCanvasSize.IsEmpty)
            {
                throw new InvalidOperationException("Assertion failed.");
            }
            if (!this.userRootElementRect.IsEmpty)
            {
                throw new InvalidOperationException("Assertion failed.");
            }
            if (this.TerminalSizeChanged != null)
            {
                throw new InvalidOperationException("Assertion failed.");
            }

            canvas.Size = new Size(args.Width, args.Height);
            renderer.RootElementRect = new Rect(canvas.Size);
            renderer.UpdateLayout();
        }
Пример #2
0
        /// <summary>
        /// Default TerminalSizeChanged event handler. Invoked when
        /// initial CanvasSize and RootElementRect are empty and no another
        /// TerminalSizeChanged handler is attached.
        /// </summary>
        public void OnTerminalSizeChangedDefault( object sender, TerminalSizeChangedEventArgs args )
        {
            if (!this.userCanvasSize.IsEmpty) throw new InvalidOperationException("Assertion failed.");
            if (!this.userRootElementRect.IsEmpty) throw new InvalidOperationException("Assertion failed.");
            if (this.TerminalSizeChanged != null) throw new InvalidOperationException("Assertion failed.");

            canvas.Size = new Size(args.Width, args.Height);
            renderer.RootElementRect = new Rect(canvas.Size);
            renderer.UpdateLayout();
        }