示例#1
0
        public override Size GetPreferredSize(Size proposedSize)
        {
            Size preferredSize;

            ErrorUtil.ThrowOnFailure(_client.GetPreferredSize(proposedSize, out preferredSize));

            return(preferredSize);
        }
示例#2
0
        protected override bool ProcessDialogChar(char charCode)
        {
            if (base.ProcessDialogChar(charCode))
            {
                return(true);
            }

            return(ErrorUtil.ThrowOnFailure(_host.ProcessDialogChar(charCode)));
        }
示例#3
0
        protected override bool ProcessDialogKey(Keys keyData)
        {
            if (base.ProcessDialogKey(keyData))
            {
                return(true);
            }

            return(ErrorUtil.ThrowOnFailure(_host.ProcessDialogKey(keyData)));
        }
示例#4
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (base.ProcessCmdKey(ref msg, keyData))
            {
                return(true);
            }

            NiMessage message = msg;
            bool      result  = ErrorUtil.ThrowOnFailure(_host.ProcessCmdKey(ref message, keyData));

            msg = message;

            return(result);
        }
示例#5
0
        protected override void Select(bool directed, bool forward)
        {
            if (_select > 0)
            {
                return;
            }

            _select++;

            try
            {
                // We were the target of select next control. Forward the
                // call to the isolation client which does its search. If it
                // matches a control, we need to make ourselves active.

                if (ErrorUtil.ThrowOnFailure(_client.SelectNextControl(!directed || forward)))
                {
                    base.Select(directed, forward);
                    return;
                }

                // If the client wasn't able to select something, we continue the
                // search from here. One small detail is that SelectNextControl
                // does not match itself. When it would match an IsolationClient,
                // this would mean that the search does not go into the
                // IsolationHost. We specifically match this case by first doing
                // a non-wrapping search and matching the root for IsolationClient.
                // If that matches, we allow the IsolationClient to continue
                // the search upwards. Otherwise, we continue the search
                // from the root as usual.

                var root = ControlUtil.GetRoot(this);

                if (root.SelectNextControl(this, !directed || forward, true, true, !(root is IsolationClient)))
                {
                    return;
                }

                if (root is IsolationClient)
                {
                    Stubs.ControlSelect(root, directed, forward);
                }
            }
            finally
            {
                _select--;
            }
        }
示例#6
0
        protected override void Select(bool directed, bool forward)
        {
            if (_select > 0)
            {
                return;
            }

            _select++;

            try
            {
                ErrorUtil.ThrowOnFailure(_host.SelectNextControl(!directed || forward));
            }
            finally
            {
                _select--;
            }
        }
示例#7
0
        public override bool PreProcessMessage(ref Message msg)
        {
            NiMessage message = msg;
            PreProcessMessageResult preProcessMessageResult;
            bool processed = ErrorUtil.ThrowOnFailure(_client.PreProcessMessage(ref message, out preProcessMessageResult));

            msg = message;

            Stubs.ControlSetState2(
                this,
                Stubs.STATE2_INPUTKEY,
                (preProcessMessageResult & PreProcessMessageResult.IsInputKey) != 0
                );

            Stubs.ControlSetState2(
                this,
                Stubs.STATE2_INPUTCHAR,
                (preProcessMessageResult & PreProcessMessageResult.IsInputChar) != 0
                );

            return(processed);
        }
示例#8
0
 protected override bool ProcessMnemonic(char charCode)
 {
     return(ErrorUtil.ThrowOnFailure(_client.ProcessMnemonic(charCode)));
 }
示例#9
0
 protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
 {
     e.IsInputKey = ErrorUtil.ThrowOnFailure(_client.PreviewKeyDown(e.KeyData));
 }