Exemple #1
0
        }// End returnQAFileName

        /// <summary>
        /// Called by QATreeForm's renameNodeButton_Click( method
        /// </summary>
        /// <param name="nodeName"></param>
        /// <param name="oldNodeText"></param>
        /// <param name="newNodeText"></param>
        /// <param name="nodeLevel"></param>
        public static void renameNode(string nodeName, string oldNodeText, string newNodeText, int nodeLevel)
        {
            // Create a character 'nodeType' to refelect the type of node being re-texted
            //char nodeType;
            if (nodeLevel == 0)
            {
                //SubjectNodesListModel.changeSubjectNodeList(nodeName, oldNodeText, newNodeText);
                TreeViewDictionaryModel.reTextNode(nodeName, newNodeText);
                QAFileNameScoresModel.reTextNameScores(nodeName, oldNodeText, newNodeText);
            }
            else if (oldNodeText.IndexOf("qa_") == 0)
            {
                //files that need to be changes are:
                //  1. TreeViewDictionary -DONE
                TreeViewDictionaryModel.reTextNode(nodeName, newNodeText);
                //  2. QAFileNameScores - DONE
                QAFileNameScoresModel.reTextNameScores(nodeName, oldNodeText, newNodeText);
                //  3. QACumulativeResults

                QACumulativeResultsModel.reTextQANode(nodeName, newNodeText);
                //  4. You do not need to change the name of the QAFile because the nodeName has not changed
            }
            else
            {
                //nodeType = 'D';
                TreeViewDictionaryModel.reTextNode(nodeName, newNodeText);
                QAFileNameScoresModel.reTextNameScores(nodeName, oldNodeText, newNodeText);
            }
            //ChangeNodeTextValue.changeNodeTextValue(nodeType);
        }
Exemple #2
0
        /// <summary>
        /// If there is no node whose name value to nodeName then adds a new entry to
        ///  treeViewDictionary with key= nodeName and value = nodeText and saves the new Dictionary
        ///  to TreeViewDictionary.txt
        /// </summary>
        /// <param name="nodeName"></param>
        /// <param name="nodeText"></param>
        public static Boolean AddNode(string nodeName, string nodeText)
        {
            // Get a copy of the TreeView Dictionary
            //Dictionary<string, string> copyTreeViewDictionary = TreeViewDictionaryModel.getTreeViewDictionary();

            if (!TreeViewDictionary.ContainsKey(nodeName))
            {
                TreeViewDictionaryModel.addNodeToTreeViewDictionary(nodeName, nodeText);
                return(true);
            }
            else
            {
                return(false);
            }
        }// End AddNode
Exemple #3
0
        }// End saveTreeViewDictionary

        /// <summary>
        /// This method receives the 'name' of the parent of a new QA node and retruns the chain of parents
        /// </summary>
        /// <param name="name" is the delimited name of the parent of a new QA node></param>
        /// <returns></returns>
        public static string returnParentChain(string name)
        {
            // Get a copy of the TreeView Dictionary
            Dictionary <string, string> copyTreeViewDictionary = TreeViewDictionaryModel.getTreeViewDictionary();
            string parentsChain = "";
            string parentChain  = "";

            while (name.Length != 0)
            {
                string nextParentName;
                //Dictionary<string, string> thisTreeViewDictionary = AccessData.getTreeViewDictionary();
                bool success = copyTreeViewDictionary.TryGetValue(name, out nextParentName);
                parentChain = parentChain + nextParentName + "<";
                name        = QADataModelLib.DelimitedStringMethods.removeLastValue(name, '.');
                if (name.IndexOf('.') == -1)
                {
                    success     = copyTreeViewDictionary.TryGetValue(name, out nextParentName);
                    parentChain = parentChain + nextParentName;
                    return(parentChain);
                }
            }

            return(parentsChain);
        }