public void WriteXML(XmlWriter writer) { writer.WriteStartElement("Settings"); this.TheSearchers.WriteXML(writer); XMLHelper.WriteElementToXML(writer, "BGDownload", this.BGDownload); XMLHelper.WriteElementToXML(writer, "OfflineMode", this.OfflineMode); writer.WriteStartElement("Replacements"); foreach (Replacement R in this.Replacements) { writer.WriteStartElement("Replace"); XMLHelper.WriteAttributeToXML(writer, "This", R.This); XMLHelper.WriteAttributeToXML(writer, "That", R.That); XMLHelper.WriteAttributeToXML(writer, "CaseInsensitive", R.CaseInsensitive ? "Y" : "N"); writer.WriteEndElement(); //Replace } writer.WriteEndElement(); //Replacements XMLHelper.WriteElementToXML(writer, "ExportWTWRSS", this.ExportWTWRSS); XMLHelper.WriteElementToXML(writer, "ExportWTWRSSTo", this.ExportWTWRSSTo); XMLHelper.WriteElementToXML(writer, "ExportWTWXML", this.ExportWTWXML); XMLHelper.WriteElementToXML(writer, "ExportWTWXMLTo", this.ExportWTWXMLTo); XMLHelper.WriteElementToXML(writer, "WTWRecentDays", this.WTWRecentDays); XMLHelper.WriteElementToXML(writer, "ExportMissingXML", this.ExportMissingXML); XMLHelper.WriteElementToXML(writer, "ExportMissingXMLTo", this.ExportMissingXMLTo); XMLHelper.WriteElementToXML(writer, "ExportMissingCSV", this.ExportMissingCSV); XMLHelper.WriteElementToXML(writer, "ExportMissingCSVTo", this.ExportMissingCSVTo); XMLHelper.WriteElementToXML(writer, "ExportRenamingXML", this.ExportRenamingXML); XMLHelper.WriteElementToXML(writer, "ExportRenamingXMLTo", this.ExportRenamingXMLTo); XMLHelper.WriteElementToXML(writer, "ExportFOXML", this.ExportFOXML); XMLHelper.WriteElementToXML(writer, "ExportFOXMLTo", this.ExportFOXMLTo); XMLHelper.WriteElementToXML(writer, "StartupTab2", TabNameForNumber(this.StartupTab)); XMLHelper.WriteElementToXML(writer, "NamingStyle", this.NamingStyle.StyleString); XMLHelper.WriteElementToXML(writer, "NotificationAreaIcon", this.NotificationAreaIcon); XMLHelper.WriteElementToXML(writer, "VideoExtensions", this.VideoExtensionsString); XMLHelper.WriteElementToXML(writer, "OtherExtensions", this.OtherExtensionsString); XMLHelper.WriteElementToXML(writer, "ExportRSSMaxDays", this.ExportRSSMaxDays); XMLHelper.WriteElementToXML(writer, "ExportRSSMaxShows", this.ExportRSSMaxShows); XMLHelper.WriteElementToXML(writer, "ExportRSSDaysPast", this.ExportRSSDaysPast); XMLHelper.WriteElementToXML(writer, "KeepTogether", this.KeepTogether); XMLHelper.WriteElementToXML(writer, "LeadingZeroOnSeason", this.LeadingZeroOnSeason); XMLHelper.WriteElementToXML(writer, "ShowInTaskbar", this.ShowInTaskbar); XMLHelper.WriteElementToXML(writer, "IgnoreSamples", this.IgnoreSamples); XMLHelper.WriteElementToXML(writer, "ForceLowercaseFilenames", this.ForceLowercaseFilenames); XMLHelper.WriteElementToXML(writer, "RenameTxtToSub", this.RenameTxtToSub); XMLHelper.WriteElementToXML(writer, "ParallelDownloads", this.ParallelDownloads); XMLHelper.WriteElementToXML(writer, "AutoSelectShowInMyShows", this.AutoSelectShowInMyShows); XMLHelper.WriteElementToXML(writer, "ShowEpisodePictures", this.ShowEpisodePictures); XMLHelper.WriteElementToXML(writer, "SpecialsFolderName", this.SpecialsFolderName); XMLHelper.WriteElementToXML(writer, "uTorrentPath", this.uTorrentPath); XMLHelper.WriteElementToXML(writer, "ResumeDatPath", this.ResumeDatPath); XMLHelper.WriteElementToXML(writer, "SearchRSS", this.SearchRSS); XMLHelper.WriteElementToXML(writer, "EpImgs", this.EpTBNs); XMLHelper.WriteElementToXML(writer, "NFOs", this.NFOs); XMLHelper.WriteElementToXML(writer, "XBMCImages", this.XBMCImages); XMLHelper.WriteElementToXML(writer, "pyTivoMeta", this.pyTivoMeta); XMLHelper.WriteElementToXML(writer, "pyTivoMetaSubFolder", this.pyTivoMetaSubFolder); XMLHelper.WriteElementToXML(writer, "FolderJpg", this.FolderJpg); XMLHelper.WriteElementToXML(writer, "FolderJpgIs", (int)this.FolderJpgIs); XMLHelper.WriteElementToXML(writer, "MonitoredFoldersScanType", (int)this.MonitoredFoldersScanType); XMLHelper.WriteElementToXML(writer, "SelectedXBMCType", (int)this.SelectedXBMCType); XMLHelper.WriteElementToXML(writer, "CheckuTorrent", this.CheckuTorrent); XMLHelper.WriteElementToXML(writer, "RenameCheck", this.RenameCheck); XMLHelper.WriteElementToXML(writer, "MissingCheck", this.MissingCheck); XMLHelper.WriteElementToXML(writer, "SearchLocally", this.SearchLocally); XMLHelper.WriteElementToXML(writer, "LeaveOriginals", this.LeaveOriginals); XMLHelper.WriteElementToXML(writer, "LookForDateInFilename", this.LookForDateInFilename); XMLHelper.WriteElementToXML(writer, "MonitorFolders", this.MonitorFolders); XMLHelper.WriteElementToXML(writer, "SABAPIKey", this.SABAPIKey); XMLHelper.WriteElementToXML(writer, "CheckSABnzbd", this.CheckSABnzbd); XMLHelper.WriteElementToXML(writer, "SABHostPort", this.SABHostPort); XMLHelper.WriteElementToXML(writer, "PreferredLanguage", this.PreferredLanguage); XMLHelper.WriteElementToXML(writer, "WTWDoubleClick", (int)this.WTWDoubleClick); XMLHelper.WriteElementToXML(writer, "EpJPGs", this.EpJPGs); XMLHelper.WriteElementToXML(writer, "SeriesJpg", this.SeriesJpg); XMLHelper.WriteElementToXML(writer, "Mede8erXML", this.Mede8erXML); XMLHelper.WriteElementToXML(writer, "ShrinkLargeMede8erImages", this.ShrinkLargeMede8erImages); XMLHelper.WriteElementToXML(writer, "FanArtJpg", this.FanArtJpg); XMLHelper.WriteElementToXML(writer, "DeleteEmpty", this.Tidyup.DeleteEmpty); XMLHelper.WriteElementToXML(writer, "DeleteEmptyIsRecycle", this.Tidyup.DeleteEmptyIsRecycle); XMLHelper.WriteElementToXML(writer, "EmptyIgnoreWords", this.Tidyup.EmptyIgnoreWords); XMLHelper.WriteElementToXML(writer, "EmptyIgnoreWordList", this.Tidyup.EmptyIgnoreWordList); XMLHelper.WriteElementToXML(writer, "EmptyIgnoreExtensions", this.Tidyup.EmptyIgnoreExtensions); XMLHelper.WriteElementToXML(writer, "EmptyIgnoreExtensionList", this.Tidyup.EmptyIgnoreExtensionList); XMLHelper.WriteElementToXML(writer, "EmptyMaxSizeCheck", this.Tidyup.EmptyMaxSizeCheck); XMLHelper.WriteElementToXML(writer, "EmptyMaxSizeMB", this.Tidyup.EmptyMaxSizeMB); writer.WriteStartElement("FNPRegexs"); foreach (FilenameProcessorRE re in this.FNPRegexs) { writer.WriteStartElement("Regex"); XMLHelper.WriteAttributeToXML(writer, "Enabled", re.Enabled); XMLHelper.WriteAttributeToXML(writer, "RE", re.RE); XMLHelper.WriteAttributeToXML(writer, "UseFullPath", re.UseFullPath); XMLHelper.WriteAttributeToXML(writer, "Notes", re.Notes); writer.WriteEndElement(); // Regex } writer.WriteEndElement(); // FNPRegexs writer.WriteStartElement("RSSURLs"); foreach (string s in this.RSSURLs) { XMLHelper.WriteElementToXML(writer, "URL", s); } writer.WriteEndElement(); // RSSURLs if (ShowStatusColors != null) { writer.WriteStartElement("ShowStatusTVWColors"); foreach (KeyValuePair <ShowStatusColoringType, System.Drawing.Color> e in this.ShowStatusColors) { writer.WriteStartElement("ShowStatusTVWColor"); // TODO ... Write Meta Flags XMLHelper.WriteAttributeToXML(writer, "IsMeta", e.Key.IsMetaType); XMLHelper.WriteAttributeToXML(writer, "IsShowLevel", e.Key.IsShowLevel); XMLHelper.WriteAttributeToXML(writer, "ShowStatus", e.Key.Status); XMLHelper.WriteAttributeToXML(writer, "Color", Helpers.TranslateColorToHtml(e.Value)); writer.WriteEndElement(); //ShowStatusTVWColor } writer.WriteEndElement(); // ShowStatusTVWColors } writer.WriteEndElement(); // settings }
public void WriteXML(XmlWriter writer) { writer.WriteStartElement("Settings"); this.TheSearchers.WriteXML(writer); writer.WriteStartElement("BGDownload"); writer.WriteValue(this.BGDownload); writer.WriteEndElement(); writer.WriteStartElement("OfflineMode"); writer.WriteValue(this.OfflineMode); writer.WriteEndElement(); writer.WriteStartElement("Replacements"); foreach (Replacement R in this.Replacements) { writer.WriteStartElement("Replace"); writer.WriteStartAttribute("This"); writer.WriteValue(R.This); writer.WriteEndAttribute(); writer.WriteStartAttribute("That"); writer.WriteValue(R.That); writer.WriteEndAttribute(); writer.WriteStartAttribute("CaseInsensitive"); writer.WriteValue(R.CaseInsensitive ? "Y" : "N"); writer.WriteEndAttribute(); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("ExportWTWRSS"); writer.WriteValue(this.ExportWTWRSS); writer.WriteEndElement(); writer.WriteStartElement("ExportWTWRSSTo"); writer.WriteValue(this.ExportWTWRSSTo); writer.WriteEndElement(); writer.WriteStartElement("ExportWTWXML"); writer.WriteValue(this.ExportWTWXML); writer.WriteEndElement(); writer.WriteStartElement("ExportWTWXMLTo"); writer.WriteValue(this.ExportWTWXMLTo); writer.WriteEndElement(); writer.WriteStartElement("WTWRecentDays"); writer.WriteValue(this.WTWRecentDays); writer.WriteEndElement(); writer.WriteStartElement("ExportMissingXML"); writer.WriteValue(this.ExportMissingXML); writer.WriteEndElement(); writer.WriteStartElement("ExportMissingXMLTo"); writer.WriteValue(this.ExportMissingXMLTo); writer.WriteEndElement(); writer.WriteStartElement("ExportMissingCSV"); writer.WriteValue(this.ExportMissingCSV); writer.WriteEndElement(); writer.WriteStartElement("ExportMissingCSVTo"); writer.WriteValue(this.ExportMissingCSVTo); writer.WriteEndElement(); writer.WriteStartElement("ExportRenamingXML"); writer.WriteValue(this.ExportRenamingXML); writer.WriteEndElement(); writer.WriteStartElement("ExportRenamingXMLTo"); writer.WriteValue(this.ExportRenamingXMLTo); writer.WriteEndElement(); writer.WriteStartElement("ExportFOXML"); writer.WriteValue(this.ExportFOXML); writer.WriteEndElement(); writer.WriteStartElement("ExportFOXMLTo"); writer.WriteValue(this.ExportFOXMLTo); writer.WriteEndElement(); writer.WriteStartElement("StartupTab2"); writer.WriteValue(TabNameForNumber(this.StartupTab)); writer.WriteEndElement(); writer.WriteStartElement("NamingStyle"); writer.WriteValue(this.NamingStyle.StyleString); writer.WriteEndElement(); writer.WriteStartElement("NotificationAreaIcon"); writer.WriteValue(this.NotificationAreaIcon); writer.WriteEndElement(); writer.WriteStartElement("VideoExtensions"); writer.WriteValue(this.VideoExtensionsString); writer.WriteEndElement(); writer.WriteStartElement("OtherExtensions"); writer.WriteValue(this.OtherExtensionsString); writer.WriteEndElement(); writer.WriteStartElement("ExportRSSMaxDays"); writer.WriteValue(this.ExportRSSMaxDays); writer.WriteEndElement(); writer.WriteStartElement("ExportRSSMaxShows"); writer.WriteValue(this.ExportRSSMaxShows); writer.WriteEndElement(); writer.WriteStartElement("ExportRSSDaysPast"); writer.WriteValue(this.ExportRSSDaysPast); writer.WriteEndElement(); writer.WriteStartElement("KeepTogether"); writer.WriteValue(this.KeepTogether); writer.WriteEndElement(); writer.WriteStartElement("LeadingZeroOnSeason"); writer.WriteValue(this.LeadingZeroOnSeason); writer.WriteEndElement(); writer.WriteStartElement("ShowInTaskbar"); writer.WriteValue(this.ShowInTaskbar); writer.WriteEndElement(); writer.WriteStartElement("IgnoreSamples"); writer.WriteValue(this.IgnoreSamples); writer.WriteEndElement(); writer.WriteStartElement("ForceLowercaseFilenames"); writer.WriteValue(this.ForceLowercaseFilenames); writer.WriteEndElement(); writer.WriteStartElement("RenameTxtToSub"); writer.WriteValue(this.RenameTxtToSub); writer.WriteEndElement(); writer.WriteStartElement("ParallelDownloads"); writer.WriteValue(this.ParallelDownloads); writer.WriteEndElement(); writer.WriteStartElement("AutoSelectShowInMyShows"); writer.WriteValue(this.AutoSelectShowInMyShows); writer.WriteEndElement(); writer.WriteStartElement("ShowEpisodePictures"); writer.WriteValue(this.ShowEpisodePictures); writer.WriteEndElement(); writer.WriteStartElement("SpecialsFolderName"); writer.WriteValue(this.SpecialsFolderName); writer.WriteEndElement(); writer.WriteStartElement("uTorrentPath"); writer.WriteValue(this.uTorrentPath); writer.WriteEndElement(); writer.WriteStartElement("ResumeDatPath"); writer.WriteValue(this.ResumeDatPath); writer.WriteEndElement(); writer.WriteStartElement("SearchRSS"); writer.WriteValue(this.SearchRSS); writer.WriteEndElement(); writer.WriteStartElement("EpImgs"); writer.WriteValue(this.EpImgs); writer.WriteEndElement(); writer.WriteStartElement("NFOs"); writer.WriteValue(this.NFOs); writer.WriteEndElement(); writer.WriteStartElement("pyTivoMeta"); writer.WriteValue(this.pyTivoMeta); writer.WriteEndElement(); writer.WriteStartElement("pyTivoMetaSubFolder"); writer.WriteValue(this.pyTivoMetaSubFolder); writer.WriteEndElement(); writer.WriteStartElement("FolderJpg"); writer.WriteValue(this.FolderJpg); writer.WriteEndElement(); writer.WriteStartElement("FolderJpgIs"); writer.WriteValue((int)this.FolderJpgIs); writer.WriteEndElement(); writer.WriteStartElement("CheckuTorrent"); writer.WriteValue(this.CheckuTorrent); writer.WriteEndElement(); writer.WriteStartElement("RenameCheck"); writer.WriteValue(this.RenameCheck); writer.WriteEndElement(); writer.WriteStartElement("MissingCheck"); writer.WriteValue(this.MissingCheck); writer.WriteEndElement(); writer.WriteStartElement("SearchLocally"); writer.WriteValue(this.SearchLocally); writer.WriteEndElement(); writer.WriteStartElement("LeaveOriginals"); writer.WriteValue(this.LeaveOriginals); writer.WriteEndElement(); writer.WriteStartElement("LookForDateInFilename"); writer.WriteValue(this.LookForDateInFilename); writer.WriteEndElement(); writer.WriteStartElement("MonitorFolders"); writer.WriteValue(this.MonitorFolders); writer.WriteEndElement(); writer.WriteStartElement("SABAPIKey"); writer.WriteValue(this.SABAPIKey); writer.WriteEndElement(); writer.WriteStartElement("CheckSABnzbd"); writer.WriteValue(this.CheckSABnzbd); writer.WriteEndElement(); writer.WriteStartElement("SABHostPort"); writer.WriteValue(this.SABHostPort); writer.WriteEndElement(); writer.WriteStartElement("PreferredLanguage"); writer.WriteValue(this.PreferredLanguage); writer.WriteEndElement(); writer.WriteStartElement("WTWDoubleClick"); writer.WriteValue((int)this.WTWDoubleClick); writer.WriteEndElement(); writer.WriteStartElement("FNPRegexs"); foreach (FilenameProcessorRE re in this.FNPRegexs) { writer.WriteStartElement("Regex"); writer.WriteStartAttribute("Enabled"); writer.WriteValue(re.Enabled); writer.WriteEndAttribute(); writer.WriteStartAttribute("RE"); writer.WriteValue(re.RE); writer.WriteEndAttribute(); writer.WriteStartAttribute("UseFullPath"); writer.WriteValue(re.UseFullPath); writer.WriteEndAttribute(); writer.WriteStartAttribute("Notes"); writer.WriteValue(re.Notes); writer.WriteEndAttribute(); writer.WriteEndElement(); // Regex } writer.WriteEndElement(); // FNPRegexs writer.WriteStartElement("RSSURLs"); foreach (string s in this.RSSURLs) { writer.WriteStartElement("URL"); writer.WriteValue(s); writer.WriteEndElement(); } writer.WriteEndElement(); // RSSURL if (ShowStatusColors != null) { writer.WriteStartElement("ShowStatusTVWColors"); foreach (KeyValuePair <ShowStatusColoringType, System.Drawing.Color> e in this.ShowStatusColors) { writer.WriteStartElement("ShowStatusTVWColor"); // TODO ... Write Meta Flags writer.WriteStartAttribute("IsMeta"); writer.WriteValue(e.Key.IsMetaType); writer.WriteEndAttribute(); writer.WriteStartAttribute("IsShowLevel"); writer.WriteValue(e.Key.IsShowLevel); writer.WriteEndAttribute(); writer.WriteStartAttribute("ShowStatus"); writer.WriteValue(e.Key.Status); writer.WriteEndAttribute(); writer.WriteStartAttribute("Color"); writer.WriteValue(Helpers.TranslateColorToHtml(e.Value)); writer.WriteEndAttribute(); writer.WriteEndElement(); } writer.WriteEndElement(); // ShowStatusTVWColors } writer.WriteEndElement(); // settings }