コード例 #1
0
        /// <summary>
        /// Gets or creates the global lists document.
        /// </summary>
        /// <returns></returns>
        private XmlDocument GetOrCreateGlobalListsXmlDocument(WorkItemStore workItemStore)
        {
            if (workItemStore == null)
            {
                throw new ArgumentNullException("workItemStore");
            }

            XmlDocument xmlDocument = workItemStore.ExportGlobalLists();

            if (xmlDocument != null)
            {
                return(xmlDocument);
            }

            xmlDocument = new XmlDocument();
            //Define encoding for non english languages
            XmlProcessingInstruction xmlProcessingInstruction = xmlDocument.CreateProcessingInstruction(ProcessingInstructionTarget, ProcessingInstructionData);

            xmlDocument.AppendChild(xmlProcessingInstruction);
            var globalListsRoot = xmlDocument.CreateElement(GlobalListsPrefix, GlobalListsIdentifier, GlobalListsNamespace);

            xmlDocument.AppendChild(globalListsRoot);

            return(xmlDocument);
        }
コード例 #2
0
        public List <string> GetTeamList(string team)
        {
            XmlDocument globallistxml = Store.ExportGlobalLists();
            var         Teams         = new List <string>();

            foreach (XmlElement element in globallistxml.GetElementsByTagName("GLOBALLIST"))
            {
                if (element.Attributes["name"].Value.ToLower().Equals(team.ToLower()))
                {
                    foreach (XmlNode childNode in element.ChildNodes)
                    {
                        if (childNode.Attributes != null)
                        {
                            Teams.Add(StringHandler.StringInputChecker(childNode.Attributes["value"].Value));
                        }
                    }
                }
            }
            return(Teams);
        }
コード例 #3
0
 /// <summary>
 /// Exports the global lists.
 /// </summary>
 public static void ExportGlobalLists()
 {
     globalLists = itemStore.ExportGlobalLists();
 }