コード例 #1
0
ファイル: Editor.cs プロジェクト: Ardasteus/UML-Editor
        private void HandleRightClick(Vector mouse_position, MouseEventArgs e)
        {
            INode temp = Children.FirstOrDefault(x => CheckIfClicked(mouse_position, x));

            if (temp == null)
            {
                temp = RelationshipManager.Relationships.FirstOrDefault(x => CheckIfClicked(mouse_position, x));
            }
            if (temp != null)
            {
                if (temp is ClassDiagramNode cn)
                {
                    IOptionsNode op = SearchForOptionsNode(temp, mouse_position);
                    op.OptionsPrefab.Position = mouse_position;
                    op.OnOptionsShow?.Invoke(this, EventArgs.Empty);
                }
                else if (temp is Relationship rs)
                {
                    OnOptionsHide?.Invoke(this, EventArgs.Empty);
                    rs.OptionsPrefab.Position = mouse_position;
                    rs.OnOptionsShow?.Invoke(this, EventArgs.Empty);
                    focusedRelationship = rs;
                }
            }
            else
            {
                OptionsPrefab.Position = mouse_position;
                OnOptionsShow?.Invoke(this, EventArgs.Empty);
            }
        }
コード例 #2
0
 public OptionsMenuEventArgs(IOptionsNode optionsNode)
 {
     Node = optionsNode;
 }