本文整理汇总了C#中IDiagramPresenter.Update方法的典型用法代码示例。如果您正苦于以下问题:C# IDiagramPresenter.Update方法的具体用法?C# IDiagramPresenter.Update怎么用?C# IDiagramPresenter.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDiagramPresenter
的用法示例。
在下文中一共展示了IDiagramPresenter.Update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessKeyEvent
/// <summary>
/// Processes a keyboard event.
/// </summary>
/// <param name="diagramPresenter">Diagram presenter where the event occurred.</param>
/// <param name="e">Description of the keyboard event.</param>
/// <returns>True if the event was handled, false if the event was not handled.</returns>
public virtual bool ProcessKeyEvent(IDiagramPresenter diagramPresenter, KeyEventArgsDg e) {
if (diagramPresenter == null) throw new ArgumentNullException("diagramPresenter");
bool result = false;
switch (e.EventType) {
case KeyEventType.KeyDown:
// Cancel tool
if (e.KeyCode == (int)KeysDg.Escape) {
Cancel();
result = true;
}
break;
case KeyEventType.KeyPress:
case KeyEventType.PreviewKeyDown:
case KeyEventType.KeyUp:
// do nothing
break;
default: throw new NShapeUnsupportedValueException(e.EventType);
}
diagramPresenter.Update();
return result;
}
示例2: ProcessMouseEvent
/// <summary>
/// Processes a mouse event.
/// </summary>
/// <param name="diagramPresenter">Diagram presenter where the event occurred.</param>
/// <param name="e">Description of the mouse event.</param>
/// <remarks>When overriding, the base classes method has to be called at the end.</remarks>
/// <returns>True if the event was handled, false if the event was not handled.</returns>
public virtual bool ProcessMouseEvent(IDiagramPresenter diagramPresenter, MouseEventArgsDg e) {
if (diagramPresenter == null) throw new ArgumentNullException("display");
currentMouseState.Buttons = e.Buttons;
currentMouseState.Modifiers = e.Modifiers;
diagramPresenter.ControlToDiagram(e.Position, out currentMouseState.Position);
diagramPresenter.Update();
return false;
}