當前位置: 首頁>>代碼示例>>C#>>正文


C# Methods.ReadXML方法代碼示例

本文整理匯總了C#中System.Methods.ReadXML方法的典型用法代碼示例。如果您正苦於以下問題:C# Methods.ReadXML方法的具體用法?C# Methods.ReadXML怎麽用?C# Methods.ReadXML使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Methods的用法示例。


在下文中一共展示了Methods.ReadXML方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LoadBindings

        private void LoadBindings()
        {
            this.treeView1.Nodes.Clear();

            this.treeView1.DrawMode = TreeViewDrawMode.OwnerDrawText;
            this.treeView1.DrawNode += new DrawTreeNodeEventHandler(DrawNode);

            Methods _methods = new Methods();
            TemplateCustomXML tXML = _methods.ReadXML<TemplateCustomXML>(Globals.ThisAddIn.Application.ActiveDocument);
            Tools.Models.Template _temp = null;
            if (tXML != null)
            {
                _temp = _temp = ThisAddIn._document<Tools.Models.Template>(tXML.TemplateID);// 
                
                _temp.AutoDocuments.ForEach(au =>
                {
                    au = _unitOfWork.AutoDocumentRepository.FindBy(id => id.AutoDocumentID == au.AutoDocumentID, "BookMarkDatas");

                    TreeNode document = new TreeNode(au.Name);
                    document.Name = au.AutoDocumentID;


                    _temp.BookMarks.ForEach(bkmk =>
                    {
                        var bkd = au.BookMarkDatas.Where(aubd => aubd.BookMarkID == bkmk.BookMarkID).FirstOrDefault();
                        if (bkd == null)
                        {
                            var node = new TreeNode(bkmk.BookmarkName);
                            node.Tag = bkmk.BookmarkName;
                            node.Name = bkmk.BookMarkID;
                            node.ForeColor = System.Drawing.Color.Red;
                            document.Nodes.Add(node);

                            // document.ForeColor = System.Drawing.Color.Black;
                            document.ForeColor = System.Drawing.Color.Red;

                        }
                        else
                        {
                            var node = new TreeNode((bkmk.BookmarkName + " = " + bkd.BookMarkValue));
                            node.Tag = bkmk.BookmarkName;
                            node.Name = bkmk.BookMarkID;
                            document.Nodes.Add(node);

                        }


                    });

                    document.Checked = document.Nodes.Descendants().Where(n => n.ForeColor == System.Drawing.Color.Red).Any() ? false : true;
                    this.treeView1.Nodes.Add(document);
                    this.treeView1.CheckBoxes = true;

                });
            }
            
        }
開發者ID:McKabue,項目名稱:ReportGen,代碼行數:57,代碼來源:UserControlTaskPane.cs

示例2: AutoDocSaveFolder

        public void AutoDocSaveFolder(Office.IRibbonControl control)
        {
            //System.Windows.Forms.SaveFileDialog save = new System.Windows.Forms.SaveFileDialog();
            //save.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            //save.RestoreDirectory = true;

            System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
            if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //System.Windows.Forms.MessageBox.Show(fbd.SelectedPath);
                Methods _methods = new Methods();
                TemplateCustomXML tXML = _methods.ReadXML<TemplateCustomXML>(Globals.ThisAddIn.Application.ActiveDocument);
                Tools.Models.Template _temp = null;
                if (tXML != null) _temp = _temp = ThisAddIn._document<Tools.Models.Template>(tXML.TemplateID);//

                _temp.AutoDocumentsPath = fbd.SelectedPath;
                ThisAddIn._unitOfWork.Save();
            }
        }
開發者ID:McKabue,項目名稱:ReportGen,代碼行數:19,代碼來源:Callbacks.MyRibbon.cs

示例3: LoadDocumentButtons

        private void LoadDocumentButtons()
        {
            Methods _methods = new Methods();
            TemplateCustomXML tXML = _methods.ReadXML<TemplateCustomXML>(Globals.ThisAddIn.Application.ActiveDocument);
            Template _temp = null;
            if (tXML != null) _temp = _temp = ThisAddIn._document<Template>(tXML.TemplateID);//

            foreach (AutoDocument autoD in _temp.AutoDocuments)
            {
                Button lb1 = new Button();
                lb1.Text = autoD.Name;
                lb1.AutoSize = true;
                lb1.Name = autoD.AutoDocumentID;
                lb1.Click += new EventHandler(ButtonClick);
                flowLayoutPanel1.Controls.Add(lb1);
            }

            for (int i = 1; i <= (_temp.Number - _temp.AutoDocuments.Count()); i++)
            {
                Button lb1 = new Button();
                lb1.Text = "Unnamed Document " + i;
                lb1.AutoSize = true;
                lb1.Name = "";
                lb1.Click += new EventHandler(ButtonClick);
                flowLayoutPanel1.Controls.Add(lb1);
            }
        }
開發者ID:McKabue,項目名稱:ReportGen,代碼行數:27,代碼來源:BookmarkDataPopup.cs


注:本文中的System.Methods.ReadXML方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。