Método Diagram.OnViewMouseEnter
Permite que as classes derivadas executar uma ação quando o ponteiro do mouse entra em modo de exibição Diagrama de cliente.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (em Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll)
Sintaxe
'Declaração
Public Overridable Sub OnViewMouseEnter ( _
pointArgs As DiagramPointEventArgs _
)
public virtual void OnViewMouseEnter(
DiagramPointEventArgs pointArgs
)
Parâmetros
- pointArgs
Tipo: Microsoft.VisualStudio.Modeling.Diagrams.DiagramPointEventArgs
Dados do evento.Para obter uma lista de argumentos, consulte DiagramPointEventArgs.
Exemplos
public override void OnViewMouseEnter(DslDiagrams::DiagramPointEventArgs pointArgs)
{
if (pointArgs == null) throw new global::System.ArgumentNullException("pointArgs");
DslDiagrams::DiagramView activeView = this.ActiveDiagramView;
if(activeView != null)
{
DslDiagrams::MouseAction action = null;
if (activeView.SelectedToolboxItemSupportsFilterString(global::Microsoft.SequenceDiagramModel2.SequenceDiagramModel2ToolboxHelper.SyncMessageFilterString))
{
if (this.syncMessageConnectAction == null)
{
this.syncMessageConnectAction = new global::Microsoft.SequenceDiagramModel2.SyncMessageConnectAction(this);
this.syncMessageConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
}
action = this.syncMessageConnectAction;
}
else if (activeView.SelectedToolboxItemSupportsFilterString(global::Microsoft.SequenceDiagramModel2.SequenceDiagramModel2ToolboxHelper.CreateMessageFilterString))
{
if (this.createMessageConnectAction == null)
{
this.createMessageConnectAction = new global::Microsoft.SequenceDiagramModel2.CreateMessageConnectAction(this);
this.createMessageConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
}
action = this.createMessageConnectAction;
}
else if (activeView.SelectedToolboxItemSupportsFilterString(global::Microsoft.SequenceDiagramModel2.SequenceDiagramModel2ToolboxHelper.AsyncMessageFilterString))
{
if (this.asyncMessageConnectAction == null)
{
this.asyncMessageConnectAction = new global::Microsoft.SequenceDiagramModel2.AsyncMessageConnectAction(this);
this.asyncMessageConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
}
action = this.asyncMessageConnectAction;
}
else
{
action = null;
}
if (pointArgs.DiagramClientView.ActiveMouseAction != action)
{
pointArgs.DiagramClientView.ActiveMouseAction = action;
}
}
}
Segurança do .NET Framework
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de código parcialmente confiáveis.