private void LoadDependencies(DirectoryTreeNode directoryNode) { string url = directoryNode.Directory.Url; Info info = SVNManager.Instance.Info(url); List <string> dependencies = new List <string>(); Dictionary <string, string> urls = SVNManager.Instance.List(url); if (urls == null) { return; } if (Application.ReferencesCache.ContainsKey(url) && Application.ReferencesCache[url].LastRevision.Equals(info.Entry.Revision)) { this.LoadCachedDependencies(directoryNode, url, urls); } else { if (!Application.ReferencesCache.ContainsKey(url)) { Application.ReferencesCache.Append(url, false, true); } if (Application.ReferencesCache.ContainsKey(url)) { Application.ReferencesCache[url].LastRevision = info.Entry.Revision; Application.ReferencesCache.Save(); } this.LoadNonCachedDependencies(directoryNode, url, urls); } directoryNode.Expand(); }
private void LoadContent(DirectoryTreeNode directoryNode) { Dictionary <string, string> list = SVNManager.Instance.List(directoryNode.Directory.Url); foreach (string name in list.Keys) { string url = string.Format("{0}/{1}", directoryNode.Directory.Url, name); Info info = SVNManager.Instance.Info(url); if (info == null) { continue; } if (info.Entry.IsDirectory) { Directory directory = this.PluginData.Content[name] as Directory; bool contains = directory != null; if (!contains) { directory = new Directory(name, directoryNode.FullPath, url); } directory.Url = url; DirectoryTreeNode node = new DirectoryTreeNode(directory); node.SelectedImageIndex = 0; node.ImageIndex = 0; node.Checked = contains; directoryNode.Nodes.Add(node); } else { File file = this.PluginData.Content[name] as File; bool contains = file != null; if (!contains) { file = new File(name, directoryNode.FullPath, url); } FileTreeNode node = new FileTreeNode(file); node.SelectedImageIndex = 1; node.ImageIndex = 1; node.Checked = contains; directoryNode.Nodes.Add(node); } } foreach (TreeNode node in directoryNode.Nodes) { if (node is DirectoryTreeNode) { LoadContent(node as DirectoryTreeNode); } } directoryNode.Expand(); }