Esempio n. 1
0
        /// <summary>
        /// This method will delete the all the child layout for the node
        /// </summary>
        /// <param name="SelectedNode">
        /// </param>
        private void DeleteNode(BrainstormingNodeVM SelectedNode)
        {
            if ((SelectedNode.Info as INodeInfo).OutNeighbors != null &&
                (SelectedNode.Info as INodeInfo).OutNeighbors.Count() > 0)
            {
                for (int i = (SelectedNode.Info as INodeInfo).OutNeighbors.Count() - 1;
                     (SelectedNode.Info as INodeInfo).OutNeighbors.Count() - 1 >= i && i >= 0;
                     i--)
                {
                    BrainstormingNodeVM c =
                        (SelectedNode.Info as INodeInfo).OutNeighbors.ElementAt(i) as BrainstormingNodeVM;
                    this.DeleteNode(c);
                }
            }

            if ((SelectedNode.Info as INodeInfo).InOutConnectors != null)
            {
                for (int i = (SelectedNode.Info as INodeInfo).InOutConnectors.Count() - 1;
                     (SelectedNode.Info as INodeInfo).InOutConnectors.Count() - 1 >= i && i >= 0;
                     i--)
                {
                    BrainstormingConnectorVM con =
                        (SelectedNode.Info as INodeInfo).InOutConnectors.ElementAt(i) as BrainstormingConnectorVM;
                    (this.Connectors as ObservableCollection <BrainstormingConnectorVM>).Remove(con);
                }
            }

            (this.Nodes as ObservableCollection <BrainstormingNodeVM>).Remove(SelectedNode);
        }
Esempio n. 2
0
        /// <summary>
        /// The connect.
        /// </summary>
        /// <param name="SelectedNode">
        /// The selected node.
        /// </param>
        /// <param name="n">
        /// The n.
        /// </param>
        /// <returns>
        /// The <see cref="BrainstormingConnectorVM"/>.
        /// </returns>
        private BrainstormingConnectorVM Connect(BrainstormingNodeVM SelectedNode, BrainstormingNodeVM n)
        {
            BrainstormingConnectorVM conn = new BrainstormingConnectorVM();

            (this.Connectors as ObservableCollection <BrainstormingConnectorVM>).Add(conn);
            conn.SourceNode = SelectedNode;
            conn.TargetNode = n;
            return(conn);
        }
Esempio n. 3
0
        /// <summary>
        /// Method will execute when ItemDeletedCommand executed
        /// </summary>
        /// <param name="param">
        /// </param>
        private void ItemDeletedCommandExecute(object param)
        {
            ItemDeletedEventArgs args = param as ItemDeletedEventArgs;

            if (args.Item is BrainstormingConnectorVM)
            {
                BrainstormingConnectorVM connectorVM = args.Item as BrainstormingConnectorVM;
                BrainstormingNodeVM      sourceNode  = connectorVM.SourceNode as BrainstormingNodeVM;
                if (sourceNode != null)
                {
                    sourceNode.ChildCount--;
                }
            }
            else if (args.Item is BrainstormingNodeVM && args.Item != this.Rootnode)
            {
                this.Updatebowtielayout((args.Item as BrainstormingNodeVM).Type);
            }
        }