本文整理汇总了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;
});
}
}
示例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();
}
}
示例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);
}
}