当前位置: 首页>>代码示例>>C#>>正文


C# WorkItemStore.ExportGlobalLists方法代码示例

本文整理汇总了C#中Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.ExportGlobalLists方法的典型用法代码示例。如果您正苦于以下问题:C# WorkItemStore.ExportGlobalLists方法的具体用法?C# WorkItemStore.ExportGlobalLists怎么用?C# WorkItemStore.ExportGlobalLists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore的用法示例。


在下文中一共展示了WorkItemStore.ExportGlobalLists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ControlloGlobalList

        /// <summary>
        /// controllo Global List
        /// </summary>
        /// <param name="tfs">
        /// connessione a TFS
        /// </param>
        /// <param name="project">
        /// progetto da analizzare
        /// </param>
        /// <param name="cis">
        /// ci software
        /// </param>
        /// <returns>
        /// true o false in base all'esito
        /// </returns>
        public static bool ControlloGlobalList(TfsTeamProjectCollection tfs, string project, string cis)
        {
            var store = new WorkItemStore(tfs);
            var globallists = store.ExportGlobalLists();
            XmlNode globalList = globallists.SelectSingleNode("//GLOBALLIST[@name='CIS']");

            XmlNodeList xml = globalList.ChildNodes;
            foreach (XmlNode x in xml)
            {
                if (x.Attributes[0].Value.Equals(cis))
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:AlmatoolboxCE,项目名称:FPCounter,代码行数:32,代码来源:TFS.cs

示例2: ScriviGlobalList

        /// <summary>
        /// scrittura sulla global list.
        /// prende l'esistente e aggiunge il nuovo
        /// </summary>
        /// <param name="collection">
        /// collection a cui collegarsi
        /// </param>
        /// <param name="tp">
        /// tp per cui scrivere la global list
        /// </param>
        public static void ScriviGlobalList(String tfsName, string collection, List<TP> tp)
        {
            using (var tfs = new TfsTeamProjectCollection(new Uri(tfsName + collection), Cred))
            {
                try
                {
                    List<string> cisSoftware = new List<string>();

                    // Console.WriteLine("Avviato servizio su " + server.Uri.ToString());
                    // Console.WriteLine("loggato come " + System.Security.Principal.WindowsIdentity.GetCurrent().Name);
                    var store = new WorkItemStore(tfs);

                    // Console.WriteLine("ho creato lo store");
                    var globallists = store.ExportGlobalLists();

                    // Console.WriteLine("ho scaricato le global list");
                    RemoveAllListItem(globallists, "//GLOBALLIST[@name='CIS']");

                    // Console.WriteLine("ho rimosso i vecchi CIS");
                    var nuove = AddListItems(globallists, "//GLOBALLIST[@name='CIS']", "LISTITEM", "non disponibile");
                    foreach (var cis in tp)
                    {
                        if (!cisSoftware.Contains(cis.CISoftware))
                        {
                            cisSoftware.Add(cis.CISoftware);
                            nuove = AddListItems(globallists, "//GLOBALLIST[@name='CIS']", "LISTITEM", cis.CISoftware);
                        }
                    }

                    // Console.WriteLine("ho creato le nuove global list");

                    // var xmlFileName = System.IO.Directory.GetCurrentDirectory() + @"\tmp.xml";
                    // globallists.Save(xmlFileName);
                    store.ImportGlobalLists(globallists.InnerXml);
                    store.RefreshCache();

                    // Console.WriteLine("ho importato le nuove global list su tfs " + server.Uri.ToString());
                    // Console.WriteLine("operazione completata");
                }
                catch (Exception ex)
                {
                    Logger.Error(new LogInfo(System.Reflection.MethodBase.GetCurrentMethod(), "INT", string.Format("errore in scrittura GlobalList: {0}", ex.Message)));
                    throw ex;
                }
            }
        }
开发者ID:AlmatoolboxCE,项目名称:FPCounter,代码行数:56,代码来源:TFS.cs

示例3: GetOrCreateGlobalListsXmlDocument

        /// <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;
        }
开发者ID:jbattermann,项目名称:JB.Tfs.Common,代码行数:23,代码来源:GlobalListCollection.cs


注:本文中的Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.ExportGlobalLists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。