public static FilterFile FromStream(string filterFullPath, Stream stream) { var filterFile = new FilterFile { FilterFullPath = filterFullPath }; var xmldoc = new XmlDocument(); xmldoc.Load(stream); var configNode = xmldoc.SelectSingleNode("Config"); var sourceSlnNode = configNode.SelectSingleNode("SourceSLN"); filterFile.SourceSolutionFullPath = Path.Combine( Path.GetDirectoryName(filterFullPath), Path.GetFileName(sourceSlnNode.InnerText)); XmlNode watchForChangesNode = configNode.SelectSingleNode("WatchForChangesOnFilteredSolution"); if (watchForChangesNode != null) { filterFile.WatchForChangesOnFilteredSolution = bool.Parse(watchForChangesNode.InnerText); } XmlNode copyReSharperFilesNode = configNode.SelectSingleNode("CopyReSharperFiles"); if (copyReSharperFilesNode != null) { filterFile.CopyReSharperFiles = bool.Parse(copyReSharperFilesNode.InnerText); } foreach (XmlNode node in configNode.SelectNodes("ProjectToKeep")) { filterFile.ProjectsToKeep.Add(node.InnerText); } return filterFile; }
public FilteredSolutionWatcher( AcceptDifferencesHandler handler, FilterFile filterFile, SolutionFile filteredSolution) { r_acceptDifferencesHandler = handler; r_filterFile = filterFile; m_filteredSolution = filteredSolution; r_watcher = new FileSystemWatcher { NotifyFilter = NotifyFilters.LastWrite, Path = Path.GetDirectoryName(m_filteredSolution.SolutionFullPath), Filter = Path.GetFileName(m_filteredSolution.SolutionFullPath) }; r_watcher.Changed += OnChanged; }
public FilteredSolutionWatcher( AcceptDifferencesHandler handler, FilterFile filterFile, SolutionFile filteredSolution) { r_acceptDifferencesHandler = handler; r_filterFile = filterFile; m_filteredSolution = filteredSolution; r_watcher = new FileSystemWatcher { NotifyFilter = NotifyFilters.LastWrite, Path = Path.GetDirectoryName(m_filteredSolution.SolutionFullPath), Filter = Path.GetFileName(m_filteredSolution.SolutionFullPath) }; r_watcher.Changed += OnChanged; }
public static FilterFile FromStream(string filterFullPath, Stream stream) { var filterFile = new FilterFile { FilterFullPath = filterFullPath }; var xmldoc = new XmlDocument(); xmldoc.Load(stream); var configNode = xmldoc.SelectSingleNode("Config"); var sourceSlnNode = configNode.SelectSingleNode("SourceSLN"); filterFile.SourceSolutionFullPath = Path.Combine( Path.GetDirectoryName(filterFullPath), Path.GetFileName(sourceSlnNode.InnerText)); XmlNode watchForChangesNode = configNode.SelectSingleNode("WatchForChangesOnFilteredSolution"); if (watchForChangesNode != null) { filterFile.WatchForChangesOnFilteredSolution = bool.Parse(watchForChangesNode.InnerText); } XmlNode copyReSharperFilesNode = configNode.SelectSingleNode("CopyReSharperFiles"); if (copyReSharperFilesNode != null) { filterFile.CopyReSharperFiles = bool.Parse(copyReSharperFilesNode.InnerText); } foreach (XmlNode node in configNode.SelectNodes("ProjectToKeep")) { filterFile.ProjectsToKeep.Add(node.InnerText); } return(filterFile); }