本文整理汇总了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;
}
示例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;
}
}
}
示例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;
}