public DependencyAssemblyTreeNode(DependencyAssembly dependencyAssembly)
 {
     this._dependencyAssembly = dependencyAssembly;
     this.Tag         = dependencyAssembly;
     this.ToolTipText = this.ToString();
     this.Text        = this.ToString();
     this.Name        = dependencyAssembly.ToString();
 }
예제 #2
0
        private void LoadCachedDependencies(DirectoryTreeNode directoryNode, string url, Dictionary <string, string> urls)
        {
            foreach (string name in urls.Keys)
            {
                string curUrl = string.Format("{0}/{1}", url, name);

                if (!Application.ReferencesCache.ContainsKey(urls[name]))
                {
                    this.LoadNonCachedDependencies(directoryNode, url, urls);
                    return;
                }

                CacheInfo cacheInfo = Application.ReferencesCache[urls[name]];

                if (cacheInfo == null)
                {
                    Info info = SVNManager.Instance.Info(curUrl);

                    this.LoadNonCachedDependency(directoryNode, info, name, curUrl);
                }
                else if (cacheInfo.IsDirectory)
                {
                    Directory directory = new Directory(name);

                    directory.Url = curUrl;

                    DirectoryTreeNode node = new DirectoryTreeNode(directory);
                    node.ImageIndex         = 0;
                    node.SelectedImageIndex = 0;
                    directoryNode.Nodes.Add(node);
                }
                else
                {
                    DependencyAssembly dependencyAssembly = this.PluginData.DependencyAssemblies[name] as DependencyAssembly;

                    bool contains = dependencyAssembly != null;

                    if (!contains)
                    {
                        dependencyAssembly = new DependencyAssembly(name, @"Program\Bin");
                    }

                    DependencyAssemblyTreeNode node = new DependencyAssemblyTreeNode(dependencyAssembly);
                    node.Checked            = contains;
                    node.ImageIndex         = 1;
                    node.SelectedImageIndex = 1;

                    directoryNode.Nodes.Add(node);
                }
            }
        }
예제 #3
0
        private void LoadNonCachedDependency(DirectoryTreeNode directoryNode, Info info, string name, string url)
        {
            if (info == null)
            {
                return;
            }

            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.Checked            = contains;
                node.ImageIndex         = 0;
                node.SelectedImageIndex = 0;
                directoryNode.Nodes.Add(node);
            }
            else
            {
                DependencyAssembly dependencyAssembly = this.PluginData.DependencyAssemblies[name] as DependencyAssembly;

                bool contains = dependencyAssembly != null;

                if (!contains)
                {
                    dependencyAssembly = new DependencyAssembly(name, @"Program\Bin");
                }

                DependencyAssemblyTreeNode node = new DependencyAssemblyTreeNode(dependencyAssembly);
                node.Checked            = contains;
                node.ImageIndex         = 1;
                node.SelectedImageIndex = 1;

                directoryNode.Nodes.Add(node);
            }
        }
예제 #4
0
        private void tvDependencies_AfterCheck(object sender, TreeViewEventArgs e)
        {
            if (e.Node is DirectoryTreeNode && !this._checkingNode)
            {
                DialogResult dr =
                    MessageBox.Show(
                        TranslationManager.GetManager().Translate("AddDependencyForm.Mbox_Caption.CheckUncheck"),
                        TranslationManager.GetManager().Translate("Atention"),
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Exclamation);

                if (dr == DialogResult.Yes)
                {
                    this._checkingNode = true;

                    this.tvDependencies.BeforeCheck -= tvDependencies_BeforeCheck;

                    foreach (TreeNode node in e.Node.Nodes)
                    {
                        node.Checked = e.Node.Checked;
                    }

                    this._checkingNode = false;

                    this.tvDependencies.BeforeCheck += tvDependencies_BeforeCheck;
                }
            }

            if (e.Node is DependencyAssemblyTreeNode)
            {
                DependencyAssembly dependencyAssembly = (e.Node as DependencyAssemblyTreeNode).DependencyAssembly;

                if (e.Node.Checked && !this.PluginData.DependencyAssemblies.Contains(dependencyAssembly))
                {
                    this.PluginData.DependencyAssemblies.Add(dependencyAssembly);
                }
                else if (!e.Node.Checked && this.PluginData.DependencyAssemblies.Contains(dependencyAssembly))
                {
                    this.PluginData.DependencyAssemblies.Remove(dependencyAssembly);
                }
            }
        }