Inheritance: System.EventArgs
        private void OnChangeNodeTypeSingleClick(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;

            var element = sender as FrameworkElement;

            if (ChangeNodeTypeClicked != null && element != null)
            {
                var eventArgs = new ChangeNodeTypeEventArgs();

                switch (element.Name)
                {
                case "ContextMenuChangeToQuestion":
                    eventArgs.ChangedTo = ChangeNodeTypeEnum.Question;
                    break;

                case "ContextMenuChangeToIdea":
                    eventArgs.ChangedTo = ChangeNodeTypeEnum.Idea;
                    break;

                case "ContextMenuChangeToPro":
                    eventArgs.ChangedTo = ChangeNodeTypeEnum.Pro;
                    break;

                case "ContextMenuChangeToCon":
                    eventArgs.ChangedTo = ChangeNodeTypeEnum.Con;
                    break;

                case "ContextMenuChangeToMap":
                    eventArgs.ChangedTo = ChangeNodeTypeEnum.Map;
                    break;

                case "ContextMenuChangeToNote":
                    eventArgs.ChangedTo = ChangeNodeTypeEnum.Note;
                    break;

                case "ContextMenuChangeToDecision":
                    eventArgs.ChangedTo = ChangeNodeTypeEnum.Decision;
                    break;

                default:
                    eventArgs.ChangedTo = ChangeNodeTypeEnum.Empty;
                    break;
                }
                ChangeNodeTypeClicked(sender, eventArgs);
            }
            OnMenuClosed(sender, e);
        }
 private void AuthorContextMenuOnChangeNodeTypeClicked(object sender, ChangeNodeTypeEventArgs e)
 {
     if (_parentNodeControl != null)
     {
         if (_parentNodeControl.ViewModelNode.IsMapNode && e.ChangedTo != ChangeNodeTypeEnum.Map)
         {
             SuperMessageBoxService.ShowWarning("Change Node Type",
                                                "You are changing a map node, you might lose any content within the map. Are you sure you wish to continue? \r\n\r\n" +
                                                "Press YES to change node type anyway\r\n" +
                                                "Press NO to Cancel",
                                                "Yes",
                                                "No",
                                                () => _parentNodeControl.ChangeNodeType(e));
         }
         else
         {
             _parentNodeControl.ChangeNodeType(e);
         }
     }
 }
        private void OnChangeNodeTypeSingleClick(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;

            var element = sender as FrameworkElement;

            if (ChangeNodeTypeClicked != null && element != null)
            {
                var eventArgs = new ChangeNodeTypeEventArgs();

                switch (element.Name)
                {
                    case "ContextMenuChangeToQuestion":
                        eventArgs.ChangedTo = ChangeNodeTypeEnum.Question;
                        break;
                    case "ContextMenuChangeToIdea":
                        eventArgs.ChangedTo = ChangeNodeTypeEnum.Idea;
                        break;
                    case "ContextMenuChangeToPro":
                        eventArgs.ChangedTo = ChangeNodeTypeEnum.Pro;
                        break;
                    case "ContextMenuChangeToCon":
                        eventArgs.ChangedTo = ChangeNodeTypeEnum.Con;
                        break;
                    case "ContextMenuChangeToMap":
                        eventArgs.ChangedTo = ChangeNodeTypeEnum.Map;
                        break;
                    case "ContextMenuChangeToNote":
                        eventArgs.ChangedTo = ChangeNodeTypeEnum.Note;
                        break;
                    case "ContextMenuChangeToDecision":
                        eventArgs.ChangedTo = ChangeNodeTypeEnum.Decision;
                        break;
                    default:
                        eventArgs.ChangedTo = ChangeNodeTypeEnum.Empty;
                        break;
                }
                ChangeNodeTypeClicked(sender, eventArgs);
            }
            OnMenuClosed(sender, e);
        }
        private void OnChangeNodeTypeClicked(object sender, ChangeNodeTypeEventArgs e)
        {
            var nodeControl = sender as NodeControl;

            if (nodeControl != null && nodeControl.ViewModelNode != null)
            {
                IoC.GetInstance<ISuperGraphNodeFactory>().UpdateNode(nodeControl.ViewModelNode, e.ChangedTo);
            }
        }
Example #5
0
 public void ChangeNodeType(ChangeNodeTypeEventArgs e)
 {
     if (ChangeNodeTypeClicked != null)
     {
         ChangeNodeTypeClicked(this, e);
     }
 }
Example #6
0
 private void MultiNodesContextMenuOnChangeNodeTypeClicked(object sender, ChangeNodeTypeEventArgs e)
 {
     if (NodeControls.Any())
     {
         if (NodeControls.Any(q => q.ViewModelNode.IsMapNode))
         {
             SuperMessageBoxService.ShowWarning("Change Node Type",
                 "You are changing a map node, you might lose any content within the map. Are you sure you wish to continue? \r\n\r\n" +
                 "Press YES to change node type anyway\r\n" +
                 "Press NO to Cancel",
                 "Yes",
                 "No",
                 () =>
                 {
                     foreach (var selectableNode in NodeControls)
                     {
                         IoC.GetInstance<ISuperGraphNodeFactory>().UpdateNode(selectableNode.ViewModelNode, e.ChangedTo);
                     }
                 });
         }
         else
         {
             foreach (var selectableNode in NodeControls)
             {
                 IoC.GetInstance<ISuperGraphNodeFactory>().UpdateNode(selectableNode.ViewModelNode, e.ChangedTo);
             }
         }
     }
 }