ShowQuickAdd() публичный Метод

public ShowQuickAdd ( ) : void
Результат void
Пример #1
0
//        //TODO move this to platform specific operation
//#if UNITY_EDITOR
//        public bool HandleKeyEvent(Event evt, ModifierKeyState keyStates)
//        {
//            var bindings = InvertGraphEditor.KeyBindings;
//            foreach (var keyBinding in bindings)
//            {
//                if (keyBinding.Key != evt.keyCode)
//                {
//                    continue;
//                }
//                if (keyBinding.RequireAlt && !keyStates.Alt)
//                {
//                    continue;
//                }
//                if (keyBinding.RequireShift && !keyStates.Shift)
//                {
//                    continue;
//                }
//                if (keyBinding.RequireControl && !keyStates.Ctrl)
//                {
//                    continue;
//                }

//                var command = keyBinding.Command;
//                if (command != null)
//                {
//                    if (command.CanExecute(InvertGraphEditor.DesignerWindow) == null)
//                    {
//                        InvertGraphEditor.ExecuteCommand(command);
//                    }
//                    else
//                    {
//                        return false;
//                    }

//                    return true;
//                }
//                return false;
//            }
//            return false;
//        }
//#endif
        public override void OnMouseDoubleClick(MouseEvent mouseEvent)
        {
            DiagramViewModel.LastMouseEvent = mouseEvent;
            if (DrawersAtMouse == null)
            {
                DrawersAtMouse = GetDrawersAtPosition(this, mouseEvent.MousePosition).ToArray();
            }
            base.OnMouseDoubleClick(mouseEvent);
            if (DrawersAtMouse.Length < 1)
            {
                if (mouseEvent.ModifierKeyStates.Alt)
                {
                    // DiagramViewModel.ShowContainerDebug();
                }
                else
                {
                    DiagramViewModel.ShowQuickAdd();
                }

                return;
            }
            if (!BubbleEvent(d => d.OnMouseDoubleClick(mouseEvent), mouseEvent))
            {
                return;
            }
            else
            {
            }

            DiagramViewModel.Navigate();

            Refresh((IPlatformDrawer)InvertGraphEditor.PlatformDrawer);
            //Refresh((IPlatformDrawer)InvertGraphEditor.PlatformDrawer);
        }
Пример #2
0
 public override void OnMouseDown(MouseEvent mouseEvent)
 {
     base.OnMouseDown(mouseEvent);
     DiagramViewModel.LastMouseEvent = mouseEvent;
     if (DrawersAtMouse == null)
     {
         return;
     }
     if (!DrawersAtMouse.Any())
     {
         DiagramViewModel.NothingSelected();
         if (mouseEvent.ModifierKeyStates.Ctrl)
         {
             DiagramViewModel.ShowQuickAdd();
         }
         mouseEvent.Begin(SelectionRectHandler);
     }
     else
     {
         BubbleEvent(d => d.OnMouseDown(mouseEvent), mouseEvent);
     }
 }