コード例 #1
0
        public void WebUpdate()
        {
            Cursor.Current = Cursors.WaitCursor;

            try
            {
                TreeNode node = this.treeViewTemplates.SelectedNode;

                if (node is TemplateTreeNode)
                {
                    TemplateTreeNode tnode = node as TemplateTreeNode;
                    TemplateWebUpdateHelper.WebUpdate(tnode.UniqueId, tnode.Tag.ToString(), false);
                    OnTemplateUpdate(tnode.UniqueId);
                }
                else if (node != null)
                {
                    DialogResult result = result = MessageBox.Show("Are you sure you want to update all the templates\r\nrecursively contained in this node?", "Update Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result == DialogResult.Yes)
                    {
                        WebUpdate(node);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.GetType().Name + "\r\n" + ex.Message + "\r\n" + ex.StackTrace);
                MessageBox.Show("The WebUpdate feature is not functioning due to either server or firewall issues.");
            }

            Cursor.Current = Cursors.Default;
        }
コード例 #2
0
ファイル: WebTemplateLibrary.cs プロジェクト: zhh007/MyGen
        private void Save(TreeNode node, bool isGrouped)
        {
            if (node is TemplateTreeNode)
            {
                TemplateTreeNode tnode = node as TemplateTreeNode;

                string path = tnode.Tag.ToString();
                string id   = tnode.UniqueId.ToUpper();
                if (this.existingTemplates.Contains(tnode.UniqueId.ToUpper()))
                {
                    path = existingTemplates[id].ToString();
                }

                if (!UpdatedTemplateIDs.Contains(tnode.UniqueId))
                {
                    UpdatedTemplateIDs.Add(tnode.UniqueId);
                }
                TemplateWebUpdateHelper.WebUpdate(tnode.UniqueId, path, isGrouped);
            }
            else if (node != null)
            {
                foreach (TreeNode child in node.Nodes)
                {
                    Save(child, true);
                }
            }
        }
コード例 #3
0
 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);
         }
     }
 }