public override Size GetPreferredSize(Size proposedSize) { Size preferredSize; ErrorUtil.ThrowOnFailure(_client.GetPreferredSize(proposedSize, out preferredSize)); return(preferredSize); }
protected override bool ProcessDialogChar(char charCode) { if (base.ProcessDialogChar(charCode)) { return(true); } return(ErrorUtil.ThrowOnFailure(_host.ProcessDialogChar(charCode))); }
protected override bool ProcessDialogKey(Keys keyData) { if (base.ProcessDialogKey(keyData)) { return(true); } return(ErrorUtil.ThrowOnFailure(_host.ProcessDialogKey(keyData))); }
int IIsolationClient.ProcessMnemonic(char charCode) { try { return(ProcessMnemonic(charCode) ? 0 : 1); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
int IIsolationHost.ProcessDialogChar(char charData) { try { return(ProcessDialogChar(charData) ? 0 : 1); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
int IIsolationHost.ProcessDialogKey(Keys keyData) { try { return(ProcessDialogKey(keyData) ? 0 : 1); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
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); }
int IIsolationClient.GetPreferredSize(Size proposedSize, out Size preferredSize) { preferredSize = new Size(); try { preferredSize = GetPreferredSize(proposedSize); return(0); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
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)); } }
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--; } }
protected override void Select(bool directed, bool forward) { if (_select > 0) { return; } _select++; try { ErrorUtil.ThrowOnFailure(_host.SelectNextControl(!directed || forward)); } finally { _select--; } }
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)); } }
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); }
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)); } }
protected override bool ProcessMnemonic(char charCode) { return(ErrorUtil.ThrowOnFailure(_client.ProcessMnemonic(charCode))); }
protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e) { e.IsInputKey = ErrorUtil.ThrowOnFailure(_client.PreviewKeyDown(e.KeyData)); }