public void Delete(TemplateTreeNode node)
        {
            if (node != null)
            {
                FileInfo info = new FileInfo(node.Tag.ToString());
                if (info.Exists)
                {
                    OnTemplateDelete(node.Tag.ToString());

                    info.Delete();
                }
            }
        }
 public void WebUpdate(TreeNode parentNode)
 {
     foreach (TreeNode node in parentNode.Nodes)
     {
         if (node is TemplateTreeNode)
         {
             TemplateTreeNode tnode = node as TemplateTreeNode;
             TemplateWebUpdateHelper.WebUpdate(tnode.UniqueId, tnode.Tag.ToString(), true);
             OnTemplateUpdate(tnode.UniqueId);
         }
         else
         {
             WebUpdate(node);
         }
     }
 }
Beispiel #3
0
        private void View()
        {
            TemplateTreeNode node = this.treeViewTemplates.SelectedNode as TemplateTreeNode;

            if (node != null)
            {
                try
                {
                    WindowsTools.LaunchBrowser(node.Url);
                }
                catch
                {
                    Help.ShowHelp(this, node.Url);
                }
            }
        }
Beispiel #4
0
        public void LoadTemplates(string selectedid)
        {
            treeViewTemplates.Nodes.Clear();
            treeViewTemplates.HideSelection = false;
            treeBuilder = new TemplateTreeBuilder(treeViewTemplates);
            treeBuilder.LoadTemplates();

            TemplateTreeNode selectedNode = null;
            string           id           = selectedid;

            if (id != null)
            {
                id = id.ToLower();
            }
            selectedNode = FindNodeByID(id, treeViewTemplates.Nodes[0], false);

            if (selectedNode == null)
            {
                selectedNode = FindNodeByID(_lastRecordedSelectedId, treeViewTemplates.Nodes[0], false);

                if (selectedNode == null)
                {
                    selectedNode = FindNodeByID(id, treeViewTemplates.Nodes[0], true);
                }
            }

            if (selectedNode != null)
            {
                _lastRecordedSelectedId = selectedNode.UniqueId.ToLower();

                this.treeViewTemplates.SelectedNode = selectedNode;

                TreeNode parent = selectedNode.Parent;
                while (parent != null)
                {
                    parent.Expand();
                    parent = parent.Parent;
                }
            }
        }
        private void _buildChildren(SortedTreeNode rootNode, DirectoryInfo rootInfo)
        {
            ZeusTemplateHeader template;

            foreach (DirectoryInfo dirInfo in rootInfo.GetDirectories())
            {
                if (dirInfo.Attributes != (FileAttributes.System | dirInfo.Attributes))
                {
                    FolderTreeNode node = new FolderTreeNode(dirInfo.Name);
                    rootNode.AddSorted(node);

                    this._buildChildren(node, dirInfo);
                }
            }

            foreach (FileInfo fileInfo in rootInfo.GetFiles())
            {
                if (IsTemplateFile(fileInfo))
                {
                    string filename = fileInfo.FullName;

                    try
                    {
                        template = ZeusTemplateParser.LoadTemplateHeader(filename);
                        IdPathHash.Add(template.UniqueID.ToUpper(), template.FilePath + template.FileName);
                    }
                    catch
                    {
                        continue;
                    }

                    TemplateTreeNode node = new TemplateTreeNode(template, true);
                    rootNode.AddSorted(node);
                }
            }
        }
		public void Delete(TemplateTreeNode node) 
		{
			if (node != null)
			{
				FileInfo info = new FileInfo(node.Tag.ToString());
				if (info.Exists) 
				{
					OnTemplateDelete(node.Tag.ToString());

					info.Delete();
				}
			}
		}
		private void _buildChildren(SortedTreeNode rootNode, DirectoryInfo rootInfo)
		{
			ZeusTemplateHeader template;

			foreach (DirectoryInfo dirInfo in rootInfo.GetDirectories()) 
			{
				if (dirInfo.Attributes != (FileAttributes.System | dirInfo.Attributes)) 
				{
					FolderTreeNode node = new FolderTreeNode(dirInfo.Name);
					rootNode.AddSorted(node);

					this._buildChildren(node, dirInfo);
				}
			}

			foreach (FileInfo fileInfo in rootInfo.GetFiles()) 
			{
				if (IsTemplateFile(fileInfo)) 
				{
					string filename = fileInfo.FullName;

					try 
					{
						template = ZeusTemplateParser.LoadTemplateHeader(filename);
						IdPathHash.Add(template.UniqueID.ToUpper(), template.FilePath + template.FileName);
					}
					catch 
					{
						continue;
					}

					TemplateTreeNode node = new TemplateTreeNode(template, true);
					rootNode.AddSorted(node);

				}
			}
		}