示例#1
0
        int IIsolationHost.ProcessCmdKey(ref NiMessage message, Keys keyData)
        {
            try
            {
                Message msg    = message;
                bool    result = ProcessCmdKey(ref msg, keyData);
                message = msg;

                return(result ? 0 : 1);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
示例#2
0
        public int SetHost(IIsolationHost host)
        {
            try
            {
                if (host == null)
                {
                    throw new ArgumentNullException("host");
                }

                _host = host;
                _sponsor.Register((MarshalByRefObject)host);

                return(0);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
示例#3
0
        int IIsolationClient.PreviewKeyDown(Keys keyData)
        {
            try
            {
                int result = 1;

                var target = FindTarget(NativeMethods.GetFocus());
                if (target != null)
                {
                    var e = new PreviewKeyDownEventArgs(keyData);

                    Stubs.ControlOnPreviewKeyDown(target, e);

                    result = e.IsInputKey ? 0 : 1;
                }

                return(result);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }