Exemplo n.º 1
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);
        }