本文整理汇总了C#中IDiagramPresenter.ResumeUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# IDiagramPresenter.ResumeUpdate方法的具体用法?C# IDiagramPresenter.ResumeUpdate怎么用?C# IDiagramPresenter.ResumeUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDiagramPresenter
的用法示例。
在下文中一共展示了IDiagramPresenter.ResumeUpdate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessMouseEvent
public override bool ProcessMouseEvent(IDiagramPresenter diagramPresenter, MouseEventArgsDg e)
{
if (diagramPresenter == null) throw new ArgumentNullException("diagramPresenter");
bool result = false;
// get new mouse state
MouseState newMouseState = MouseState.Empty;
newMouseState.Buttons = e.Buttons;
newMouseState.Modifiers = e.Modifiers;
diagramPresenter.ControlToDiagram(e.Position, out newMouseState.Position);
diagramPresenter.SuspendUpdate();
try {
// Only process mouse action if the position of the mouse or a mouse button state changed
//if (e.EventType != MouseEventType.MouseMove || newMouseState.Position != CurrentMouseState.Position) {
// Process the mouse event
switch (e.EventType) {
case MouseEventType.MouseDown:
// Start drag action such as drawing a SelectionFrame or moving selectedShapes/shape handles
result = ProcessMouseDown(diagramPresenter, newMouseState);
break;
case MouseEventType.MouseMove:
// Set cursors depending on HotSpots or draw moving/resizing preview
result = ProcessMouseMove(diagramPresenter, newMouseState);
break;
case MouseEventType.MouseUp:
// perform selection/moving/resizing
result = ProcessMouseUp(diagramPresenter, newMouseState);
break;
default:
throw new NShapeUnsupportedValueException(e.EventType);
}
//}
}
finally {
diagramPresenter.ResumeUpdate();
}
base.ProcessMouseEvent(diagramPresenter, e);
return result;
}
示例2: ProcessMouseEvent
/// <override></override>
public override bool ProcessMouseEvent(IDiagramPresenter diagramPresenter, MouseEventArgsDg e) {
if (diagramPresenter == null) throw new ArgumentNullException("diagramPresenter");
bool result = false;
MouseState newMouseState = MouseState.Empty;
newMouseState.Buttons = e.Buttons;
newMouseState.Modifiers = e.Modifiers;
diagramPresenter.ControlToDiagram(e.Position, out newMouseState.Position);
diagramPresenter.SuspendUpdate();
try {
switch (e.EventType) {
case MouseEventType.MouseMove:
if (CurrentMouseState.Position != newMouseState.Position)
ProcessMouseMove(diagramPresenter, newMouseState);
break;
case MouseEventType.MouseDown:
// MouseDown starts drag-based actions
// ToDo: Implement these features: Adding Segments to existing Lines, Move existing Lines and their ControlPoints
if (e.Clicks > 1) result = ProcessDoubleClick(diagramPresenter, newMouseState);
else result = ProcessMouseClick(diagramPresenter, newMouseState);
break;
case MouseEventType.MouseUp:
// MouseUp finishes drag-actions. Click-based actions are handled by the MouseClick event
// ToDo: Implement these features: Adding Segments to existing Lines, Move existing Lines and their ControlPoints
break;
default: throw new NShapeUnsupportedValueException(e.EventType);
}
} finally { diagramPresenter.ResumeUpdate(); }
base.ProcessMouseEvent(diagramPresenter, e);
return result;
}
示例3: ProcessMouseEvent
/// <override></override>
public override bool ProcessMouseEvent(IDiagramPresenter diagramPresenter, MouseEventArgsDg e)
{
if (diagramPresenter == null) throw new ArgumentNullException("diagramPresenter");
bool result = false;
MouseState newMouseState = MouseState.Empty;
newMouseState.Buttons = e.Buttons;
newMouseState.Modifiers = e.Modifiers;
diagramPresenter.ControlToDiagram(e.Position, out newMouseState.Position);
diagramPresenter.SuspendUpdate();
try {
switch (e.EventType) {
case MouseEventType.MouseDown:
timer.Stop();
break;
case MouseEventType.MouseMove:
if (CurrentMouseState.Position != newMouseState.Position) {
if (newMouseState.IsButtonDown(MouseButtonsDg.Left)
&& diagramPresenter.Project.SecurityManager.IsGranted(Permission.Insert)) {
diagramPresenter.ControlToDiagram(e.Position, out p);
currentStroke.Add(p.X, p.Y);
}
diagramPresenter.SetCursor(penCursorId);
}
Invalidate(diagramPresenter);
break;
case MouseEventType.MouseUp:
if (newMouseState.IsButtonDown(MouseButtonsDg.Left)
&& diagramPresenter.Project.SecurityManager.IsGranted(Permission.Insert)) {
StartToolAction(diagramPresenter, 0, newMouseState, false);
strokeSet.Add(currentStroke);
currentStroke = new Stroke();
timer.Start();
}
break;
default: throw new NShapeUnsupportedValueException(e.EventType);
}
} finally { diagramPresenter.ResumeUpdate(); }
base.ProcessMouseEvent(diagramPresenter, e);
return result;
}