Exemplo n.º 1
0
        /// <summary>
        /// Make the UI match the current surface.
        /// </summary>
        private void MakeUIMatchSurface()
        {
            // Handle us not having a surface.
            if (_pSurface == null || _pSurface.IsDeleted())
            {
                // Disable the control.
                this.IsEnabled                = false;
                _txtLoadInstruction.Text      = "";
                _txtSurfaceName.Text          = "";
                _lblWidth.Content             = "";
                _lblHeight.Content            = "";
                _lblAngle.Content             = "";
                _txtDisplayResolution.Text    = "";
                _chkAutomaticInject.IsChecked = false;
            }
            else
            {
                // Enable the control.
                this.IsEnabled = true;

                // Update the name.
                _txtLoadInstruction.Text         = (_pSurface.ActiveDisplay != null)?_pSurface.ActiveDisplay.LoadInstruction : "";
                _txtSurfaceName.Text             = _pSurface.Identifier;
                _txtSurfaceName.Foreground       = Brushes.Black;
                _lblWidth.Content                = _pSurface.Width;
                _lblHeight.Content               = _pSurface.Height;
                _lblAngle.Content                = _pSurface.Angle;
                _chkAutomaticInject.IsChecked    = _pSurface.AttemptMultiTouchInject;
                _txtDisplayResolution.Text       = (_pSurface.ActiveDisplay != null) ? ((int)_pSurface.ActiveDisplay.RenderResolution.X) + "x" + ((int)_pSurface.ActiveDisplay.RenderResolution.Y) : "";
                _txtDisplayResolution.Foreground = Brushes.Black;

                // Update the toggle button.
                UpdateToggleDebug(_pSurface.ShowDebug);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Make the UI match the current surface.
        /// </summary>
        private void MakeUIMatchSurface()
        {
            // Handle us not having a surface.
            if (_pSurface == null || _pSurface.IsDeleted())
            {
                // Disable the control.
                this.IsEnabled = false;
            }
            else
            {
                // Enable the control.
                this.IsEnabled = true;

                // Update the name.
                this._lblName.Text = _pSurface.Identifier;

                // Update the toggle button.
                UpdateToggleDebug(_pSurface.ShowDebug);
            }
        }