Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Commit

Permalink
fixed refresh problem & closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
joergbattermann committed Feb 3, 2012
1 parent 0f0893f commit fbdbf51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions JB.Tfs.Common/GlobalListCollection.cs
Expand Up @@ -16,7 +16,6 @@ namespace JB.Tfs.Common
public class GlobalListCollection : IList<GlobalList>
{
private readonly List<GlobalList> _globalListCollection = new List<GlobalList>();
private XmlDocument _xmlDocument;

private const string ProcessingInstructionData = "version='1.0' encoding='utf-8'";
private const string ProcessingInstructionTarget = "xml";
Expand All @@ -42,9 +41,11 @@ public GlobalListCollection(WorkItemStore workItemStore)
private void FetchDataFromTeamFoundationServer(WorkItemStore workItemStore)
{
if (workItemStore == null) throw new ArgumentNullException("workItemStore");
_xmlDocument = GetOrCreateGlobalListsXmlDocument(workItemStore);

foreach (var globalListXmlElement in GetGlobalListXmlElements(_xmlDocument))
// remove previously fetched entries
_globalListCollection.Clear();

foreach (var globalListXmlElement in GetGlobalListXmlElements(GetOrCreateGlobalListsXmlDocument(workItemStore)))
{
_globalListCollection.Add(new GlobalList(globalListXmlElement));
}
Expand All @@ -61,7 +62,6 @@ private IEnumerable<XmlElement> GetGlobalListXmlElements(XmlDocument xmlDocument

if (globalListsElement == null)
throw new XmlException("GlobalList contains no proper root element.");

return (from XmlNode element in globalListsElement.ChildNodes
where element.LocalName == GlobalListIdentifier
select element as XmlElement);
Expand Down

0 comments on commit fbdbf51

Please sign in to comment.