public static ObservableCollection <Proj> LoadProjects(TeamExplorerIntergator teamExplorer)
        {
            ObservableCollection <Proj> lst = new ObservableCollection <Proj>();

            if (teamExplorer != null)
            {
                TPWiWrapper wp = new TPWiWrapper(teamExplorer);
                foreach (string s in wp.GetProjects())
                {
                    lst.Add(new Proj {
                        ProjectName = s, IsSelected = false
                    });
                }
            }

            return(lst);
        }
        public static List <WIT> LoadWITList(TeamExplorerIntergator teamExplorer, string teamProject)
        {
            List <WIT> lst = new List <WIT>();

            if (teamExplorer != null)
            {
                TPWiWrapper wp = new TPWiWrapper(teamExplorer);
                foreach (string name in wp.GetWorkItemTypes(teamProject))
                {
                    lst.Add(new WIT {
                        Name = name, xml = wp.ExportWIT(teamProject, name, false)
                    });
                }
            }

            return(lst);
        }
        internal void cmdUpdate()
        {
            TPWiWrapper wrp = new TPWiWrapper(teamExplorer);

            foreach (Proj p in Projects)
            {
                if (p.IsSelected)
                {
                    string curProj    = p.ProjectName;
                    string projectDir = BackupFolder + @"\" + curProj;
                    if (!System.IO.Directory.Exists(projectDir))
                    {
                        System.IO.Directory.CreateDirectory(projectDir);
                    }

                    if (CreateBackup)
                    {
                        foreach (WIT wit in WorkItemTypes)
                        {
                            if (wit.IsSelected)
                            {
                                if (wrp.WorkIteTypeExist(curProj, wit.Name))
                                {
                                    string    s = wrp.ExportWIT(curProj, wit.Name, true);
                                    XDocument x = new XDocument();
                                    x = XDocument.Parse(s);
                                    x.Save(projectDir + @"\" + wit.Name + ".xml");
                                }
                            }
                        }
                    }

                    foreach (WIT wit in WorkItemTypes)
                    {
                        if (wit.IsSelected)
                        {
                            wrp.ImportWIT(curProj, wit.xml);
                        }
                    }
                }
            }
        }