/// <summary> /// Method to save current view settings to document. /// </summary> internal void Save() { try { using (FileStream fs = new FileStream(configFile, FileMode.Create)) { XmlWriterSettings settings = new XmlWriterSettings(); settings.ConformanceLevel = ConformanceLevel.Document; settings.Indent = true; using (XmlWriter w = XmlWriter.Create(fs, settings)) { w.WriteStartDocument(); w.WriteStartElement("Dejaview"); w.WriteElementString("Enable", Enable.ToString()); w.WriteElementString("Prompt", Prompt.ToString()); w.WriteElementString("CheckForUpdates", CheckForUpdates.ToString()); w.WriteElementString("UpdateURL", UpdateURL); w.WriteElementString("RememberWindowLocation", RememberWindowLocation.ToString()); w.WriteElementString("RememberNavigationPanel", RememberNavigationPanel.ToString()); w.WriteElementString("RememberWindowType", RememberWindowType.ToString()); w.WriteElementString("RememberZoom", RememberZoom.ToString()); w.WriteElementString("RememberRulers", RememberRulers.ToString()); w.WriteElementString("RememberRibbon", RememberRibbon.ToString()); /* * w.WriteStartElement("Defaults"); * w.WriteAttributeString("ShowNavigationPanel", ShowNavigationPanel.ToString()); * w.WriteAttributeString("NavigationPanelWidth", NavigationPanelWidth.ToString()); * w.WriteAttributeString("WindowWidth", WindowWidth.ToString()); * w.WriteAttributeString("WindowHeight", WindowHeight.ToString()); * w.WriteAttributeString("WindowTop", WindowTop.ToString()); * w.WriteAttributeString("WindowLeft", WindowLeft.ToString()); * w.WriteAttributeString("WindowZoom", WindowZoom.ToString()); * w.WriteAttributeString("WindowViewType", WindowViewType.ToString()); * w.WriteAttributeString("DraftView", DraftView.ToString()); * w.WriteFullEndElement(); */ w.WriteEndElement(); w.WriteEndDocument(); w.Flush(); } fs.Close(); } Debug.WriteLine("DejaviewConfig::Save() -> success"); Debug.WriteLine(" Enable => " + Enable); Debug.WriteLine(" Prompt => " + Prompt); Debug.WriteLine(" Check => " + CheckForUpdates); Debug.WriteLine(" UpdateURL => " + UpdateURL); Globals.DejaviewAddIn.Log("Successfully saved configuration."); } catch (Exception ex) { Debug.WriteLine("DejaviewConfig::Save() => " + ex.StackTrace); Globals.DejaviewAddIn.Log(ex); } }
public ProviderCustomerViewModel(string oProviderCustomerId , ProveedoresOnLine.Company.Models.Company.CompanyModel oRelatedCompany , bool oEnable) { CP_CustomerProviderId = oProviderCustomerId; CP_CustomerPublicId = oRelatedCompany.CompanyPublicId; CP_Customer = oRelatedCompany.CompanyName; CP_Enable = Enable.ToString(); }
/// <summary> /// 转为XML节点 /// </summary> /// <param name="Doc">文档</param> /// <param name="name">名字</param> public void ToXml(XmlDocument Doc, String name) { XmlElement elm = Doc.CreateElement(name); elm.InnerText = FormatedValue; XmlAttribute att = Doc.CreateAttribute("Enable"); att.InnerText = Enable.ToString(); elm.Attributes.Append(att); Doc.DocumentElement.AppendChild(elm); }
public void StoreValues(Data data, string path) { data.SetValue(@"" + path + @"Enable", Enable.ToString()); data.SetValue(@"" + path + @"UsageStatsInfo", UsageStatsInfo.ToString()); }
public void StoreValues(Data data, string path) { data.SetValue(@"" + path + @"Enable", Enable.ToString()); data.SetValue(@"" + path + @"LatestRssUpdate", LatestRssUpdate.ToString("yyyy-MM-dd HH:mm:ss")); }