コード例 #1
0
        /// <summary>
        /// Adds a namespace in the corresponding namespace
        /// </summary>
        /// <param name="nameSpace"></param>
        public NameSpaceTreeNode AddSubNameSpace(DataDictionary.Types.NameSpace nameSpace)
        {
            Item.appendNameSpaces(nameSpace);
            NameSpaceTreeNode retVal = new NameSpaceTreeNode(nameSpace);

            Nodes.Add(retVal);
            SortSubNodes();

            return(retVal);
        }
コード例 #2
0
        /// <summary>
        /// Update counts according to the selected folder
        /// </summary>
        public override void SelectionChanged()
        {
            base.SelectionChanged();
            List <DataDictionary.Types.NameSpace> namespaces = new List <DataDictionary.Types.NameSpace>();

            foreach (DataDictionary.Types.NameSpace aNamespace in Item.SubNameSpaces)
            {
                namespaces.Add(aNamespace);
            }

            (BaseForm as Window).toolStripStatusLabel.Text = NameSpaceTreeNode.CreateStatMessage(namespaces, true);
        }
コード例 #3
0
        /// <summary>
        /// Accepts drop of a tree node, in a drag & drop operation
        /// </summary>
        /// <param name="SourceNode"></param>
        public override void AcceptDrop(BaseTreeNode SourceNode)
        {
            base.AcceptDrop(SourceNode);

            if (SourceNode is NameSpaceTreeNode)
            {
                NameSpaceTreeNode nameSpaceTreeNode      = SourceNode as NameSpaceTreeNode;
                DataDictionary.Types.NameSpace nameSpace = nameSpaceTreeNode.Item;

                nameSpaceTreeNode.Delete();
                AddNameSpace(nameSpace);
            }
        }
コード例 #4
0
        /// <summary>
        ///     Accepts drop of a tree node, in a drag & drop operation
        /// </summary>
        /// <param name="sourceNode"></param>
        public override void AcceptDrop(BaseTreeNode sourceNode)
        {
            base.AcceptDrop(sourceNode);

            if (sourceNode is NameSpaceTreeNode)
            {
                NameSpaceTreeNode nameSpaceTreeNode = sourceNode as NameSpaceTreeNode;
                NameSpace         nameSpace         = nameSpaceTreeNode.Item;

                nameSpaceTreeNode.Delete();
                Item.appendNameSpaces(nameSpace);
            }
        }
コード例 #5
0
        /// <summary>
        /// Accepts a drop event
        /// </summary>
        /// <param name="SourceNode"></param>
        public override void AcceptDrop(BaseTreeNode SourceNode)
        {
            base.AcceptDrop(SourceNode);

            if (isDirectory)
            {
                BaseTreeNode parent = Parent as BaseTreeNode;
                parent.AcceptDrop(SourceNode);
            }
            else
            {
                if (SourceNode is VariableTreeNode)
                {
                    variables.AcceptDrop(SourceNode);
                }
                else if (SourceNode is ProcedureTreeNode)
                {
                    procedures.AcceptDrop(SourceNode);
                }
                else if (SourceNode is RuleTreeNode)
                {
                    rules.AcceptDrop(SourceNode);
                }
                else if (SourceNode is StructureTreeNode)
                {
                    structures.AcceptDrop(SourceNode);
                }
                else if (SourceNode is NameSpaceTreeNode)
                {
                    NameSpaceTreeNode nameSpaceTreeNode      = SourceNode as NameSpaceTreeNode;
                    DataDictionary.Types.NameSpace nameSpace = nameSpaceTreeNode.Item;

                    nameSpaceTreeNode.Delete();
                    AddNameSpace(nameSpace);
                }
            }
        }
コード例 #6
0
        /// <summary>
        ///     Accepts a drop event
        /// </summary>
        /// <param name="sourceNode"></param>
        public override void AcceptDrop(BaseTreeNode sourceNode)
        {
            base.AcceptDrop(sourceNode);

            if (_isDirectory)
            {
                BaseTreeNode parent = Parent as BaseTreeNode;
                if (parent != null)
                {
                    parent.AcceptDrop(sourceNode);
                }
            }
            else
            {
                if (sourceNode is VariableTreeNode)
                {
                    NameSpaceVariablesTreeNode node = SubNode <NameSpaceVariablesTreeNode>();
                    if (node != null)
                    {
                        node.AcceptDrop(sourceNode);
                    }
                }
                else if (sourceNode is ProcedureTreeNode)
                {
                    NameSpaceProceduresTreeNode node = SubNode <NameSpaceProceduresTreeNode>();
                    if (node != null)
                    {
                        node.AcceptDrop(sourceNode);
                    }
                }
                else if (sourceNode is RuleTreeNode)
                {
                    NameSpaceRulesTreeNode node = SubNode <NameSpaceRulesTreeNode>();
                    if (node != null)
                    {
                        node.AcceptDrop(sourceNode);
                    }
                }
                else if (sourceNode is StructureTreeNode)
                {
                    StructuresTreeNode node = SubNode <StructuresTreeNode>();
                    if (node != null)
                    {
                        node.AcceptDrop(sourceNode);
                    }
                }
                else if (sourceNode is FunctionTreeNode)
                {
                    FunctionsTreeNode node = SubNode <FunctionsTreeNode>();
                    if (node != null)
                    {
                        node.AcceptDrop(sourceNode);
                    }
                }
                else if (sourceNode is InterfaceTreeNode)
                {
                    InterfacesTreeNode node = SubNode <InterfacesTreeNode>();
                    if (node != null)
                    {
                        node.AcceptDrop(sourceNode);
                    }
                }
                else if (sourceNode is NameSpaceTreeNode)
                {
                    DialogResult result = MessageBox.Show(
                        Resources.NameSpaceTreeNode_AcceptDrop_This_will_move_the_namespace__are_you_sure___,
                        Resources.NameSpaceTreeNode_AcceptDrop_Confirm_moving_the_namespace,
                        MessageBoxButtons.OKCancel,
                        MessageBoxIcon.Question);
                    if (result == DialogResult.OK)
                    {
                        NameSpaceTreeNode nameSpaceTreeNode = sourceNode as NameSpaceTreeNode;
                        NameSpace         nameSpace         = nameSpaceTreeNode.Item;

                        nameSpaceTreeNode.Delete();
                        Item.appendNameSpaces(nameSpace);
                    }
                }
            }
        }