public void StoreValues(Data data, string path) { AttachmentPage.StoreValues(data, path + @"AttachmentPage\"); AutoSave.StoreValues(data, path + @"AutoSave\"); BackgroundPage.StoreValues(data, path + @"BackgroundPage\"); CoverPage.StoreValues(data, path + @"CoverPage\"); EmailClient.StoreValues(data, path + @"EmailClient\"); EmailSmtp.StoreValues(data, path + @"EmailSmtp\"); Ftp.StoreValues(data, path + @"Ftp\"); Ghostscript.StoreValues(data, path + @"Ghostscript\"); JpegSettings.StoreValues(data, path + @"JpegSettings\"); PdfSettings.StoreValues(data, path + @"PdfSettings\"); PngSettings.StoreValues(data, path + @"PngSettings\"); Printing.StoreValues(data, path + @"Printing\"); Properties.StoreValues(data, path + @"Properties\"); SaveDialog.StoreValues(data, path + @"SaveDialog\"); Scripting.StoreValues(data, path + @"Scripting\"); Stamping.StoreValues(data, path + @"Stamping\"); TiffSettings.StoreValues(data, path + @"TiffSettings\"); data.SetValue(@"" + path + @"AuthorTemplate", Data.EscapeString(AuthorTemplate)); data.SetValue(@"" + path + @"FileNameTemplate", Data.EscapeString(FileNameTemplate)); data.SetValue(@"" + path + @"Guid", Data.EscapeString(Guid)); data.SetValue(@"" + path + @"Name", Data.EscapeString(Name)); data.SetValue(@"" + path + @"OpenViewer", OpenViewer.ToString()); data.SetValue(@"" + path + @"OutputFormat", OutputFormat.ToString()); data.SetValue(@"" + path + @"ShowProgress", ShowProgress.ToString()); data.SetValue(@"" + path + @"SkipPrintDialog", SkipPrintDialog.ToString()); data.SetValue(@"" + path + @"TitleTemplate", Data.EscapeString(TitleTemplate)); }
public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendLine("[AttachmentPage]"); sb.AppendLine(AttachmentPage.ToString()); sb.AppendLine("[AutoSave]"); sb.AppendLine(AutoSave.ToString()); sb.AppendLine("[BackgroundPage]"); sb.AppendLine(BackgroundPage.ToString()); sb.AppendLine("[CoverPage]"); sb.AppendLine(CoverPage.ToString()); sb.AppendLine("[DropboxSettings]"); sb.AppendLine(DropboxSettings.ToString()); sb.AppendLine("[EmailClientSettings]"); sb.AppendLine(EmailClientSettings.ToString()); sb.AppendLine("[EmailSmtpSettings]"); sb.AppendLine(EmailSmtpSettings.ToString()); sb.AppendLine("[Ftp]"); sb.AppendLine(Ftp.ToString()); sb.AppendLine("[Ghostscript]"); sb.AppendLine(Ghostscript.ToString()); sb.AppendLine("[JpegSettings]"); sb.AppendLine(JpegSettings.ToString()); sb.AppendLine("[PdfSettings]"); sb.AppendLine(PdfSettings.ToString()); sb.AppendLine("[PngSettings]"); sb.AppendLine(PngSettings.ToString()); sb.AppendLine("[Printing]"); sb.AppendLine(Printing.ToString()); sb.AppendLine("[Properties]"); sb.AppendLine(Properties.ToString()); sb.AppendLine("[SaveDialog]"); sb.AppendLine(SaveDialog.ToString()); sb.AppendLine("[Scripting]"); sb.AppendLine(Scripting.ToString()); sb.AppendLine("[Stamping]"); sb.AppendLine(Stamping.ToString()); sb.AppendLine("[TextSettings]"); sb.AppendLine(TextSettings.ToString()); sb.AppendLine("[TiffSettings]"); sb.AppendLine(TiffSettings.ToString()); sb.AppendLine("[UserTokens]"); sb.AppendLine(UserTokens.ToString()); sb.AppendLine("AuthorTemplate=" + AuthorTemplate.ToString()); sb.AppendLine("FileNameTemplate=" + FileNameTemplate.ToString()); sb.AppendLine("Guid=" + Guid.ToString()); sb.AppendLine("KeywordTemplate=" + KeywordTemplate.ToString()); sb.AppendLine("Name=" + Name.ToString()); sb.AppendLine("OpenViewer=" + OpenViewer.ToString()); sb.AppendLine("OpenWithPdfArchitect=" + OpenWithPdfArchitect.ToString()); sb.AppendLine("OutputFormat=" + OutputFormat.ToString()); sb.AppendLine("ShowProgress=" + ShowProgress.ToString()); sb.AppendLine("SkipPrintDialog=" + SkipPrintDialog.ToString()); sb.AppendLine("SubjectTemplate=" + SubjectTemplate.ToString()); sb.AppendLine("TitleTemplate=" + TitleTemplate.ToString()); return(sb.ToString()); }
public void StoreValues(Data data, string path) { AttachmentPage.StoreValues(data, path + @"AttachmentPage\"); AutoSave.StoreValues(data, path + @"AutoSave\"); BackgroundPage.StoreValues(data, path + @"BackgroundPage\"); CoverPage.StoreValues(data, path + @"CoverPage\"); CustomScript.StoreValues(data, path + @"CustomScript\"); DropboxSettings.StoreValues(data, path + @"DropboxSettings\"); EmailClientSettings.StoreValues(data, path + @"EmailClientSettings\"); EmailSmtpSettings.StoreValues(data, path + @"EmailSmtpSettings\"); ForwardToFurtherProfile.StoreValues(data, path + @"ForwardToFurtherProfile\"); Ftp.StoreValues(data, path + @"Ftp\"); Ghostscript.StoreValues(data, path + @"Ghostscript\"); HttpSettings.StoreValues(data, path + @"HttpSettings\"); JpegSettings.StoreValues(data, path + @"JpegSettings\"); PdfSettings.StoreValues(data, path + @"PdfSettings\"); PngSettings.StoreValues(data, path + @"PngSettings\"); Printing.StoreValues(data, path + @"Printing\"); Properties.StoreValues(data, path + @"Properties\"); Scripting.StoreValues(data, path + @"Scripting\"); Stamping.StoreValues(data, path + @"Stamping\"); TextSettings.StoreValues(data, path + @"TextSettings\"); TiffSettings.StoreValues(data, path + @"TiffSettings\"); UserTokens.StoreValues(data, path + @"UserTokens\"); Watermark.StoreValues(data, path + @"Watermark\"); for (int i = 0; i < ActionOrder.Count; i++) { data.SetValue(path + @"ActionOrder\" + i + @"\ActionOrder", Data.EscapeString(ActionOrder[i])); } data.SetValue(path + @"ActionOrder\numClasses", ActionOrder.Count.ToString()); data.SetValue(@"" + path + @"AuthorTemplate", Data.EscapeString(AuthorTemplate)); data.SetValue(@"" + path + @"EnableWorkflowEditor", EnableWorkflowEditor.ToString()); data.SetValue(@"" + path + @"FileNameTemplate", Data.EscapeString(FileNameTemplate)); data.SetValue(@"" + path + @"Guid", Data.EscapeString(Guid)); data.SetValue(@"" + path + @"KeywordTemplate", Data.EscapeString(KeywordTemplate)); data.SetValue(@"" + path + @"Name", Data.EscapeString(Name)); data.SetValue(@"" + path + @"OpenViewer", OpenViewer.ToString()); data.SetValue(@"" + path + @"OpenWithPdfArchitect", OpenWithPdfArchitect.ToString()); data.SetValue(@"" + path + @"OutputFormat", OutputFormat.ToString()); data.SetValue(@"" + path + @"SaveFileTemporary", SaveFileTemporary.ToString()); data.SetValue(@"" + path + @"ShowAllNotifications", ShowAllNotifications.ToString()); data.SetValue(@"" + path + @"ShowOnlyErrorNotifications", ShowOnlyErrorNotifications.ToString()); data.SetValue(@"" + path + @"ShowProgress", ShowProgress.ToString()); data.SetValue(@"" + path + @"ShowQuickActions", ShowQuickActions.ToString()); data.SetValue(@"" + path + @"SkipPrintDialog", SkipPrintDialog.ToString()); data.SetValue(@"" + path + @"SubjectTemplate", Data.EscapeString(SubjectTemplate)); data.SetValue(@"" + path + @"TargetDirectory", Data.EscapeString(TargetDirectory)); data.SetValue(@"" + path + @"TitleTemplate", Data.EscapeString(TitleTemplate)); }
public void Save() { try { if (IsOneView) { ViewSettingsParser.Modify(_configLocation.FileName, new ViewSettings { URL = URL, ProjectNameRegEx = ProjectNameRegEx, CategoryRegEx = CategoryRegEx, ServerNameRegEx = ServerNameRegEx, SkinName = SkinName, ViewName = ViewName, ShowOnlyBroken = ShowOnlyBroken, ShowServerName = ShowServerName, ShowOutOfDate = ShowOutOfDate, OutOfDateDifferenceInMinutes = OutOfDateDifferenceInMinutes }); } var config = OpenExeConfiguration(); config.AppSettings.Settings[PollFrequencyKey].Value = PollFrequency.ToString(); config.AppSettings.Settings[ShowCountdownKey].Value = ShowCountdown.ToString(); config.AppSettings.Settings[ShowProgressKey].Value = ShowProgress.ToString(); config.AppSettings.Settings[PlaySoundsKey].Value = PlaySounds.ToString(); config.AppSettings.Settings[PlaySpeechKey].Value = PlaySpeech.ToString(); config.AppSettings.Settings[BrokenBuildSoundKey].Value = BrokenBuildSound; config.AppSettings.Settings[FixedBuildSoundKey].Value = FixedBuildSound; config.AppSettings.Settings[BrokenBuildTextKey].Value = BrokenBuildText; config.AppSettings.Settings[FixedBuildTextKey].Value = FixedBuildText; config.AppSettings.Settings[SpeechVoiceNameKey].Value = SpeechVoiceName; config.AppSettings.Settings[BreakerGuiltStrategyKey].Value = _breakerGuiltStrategy; config.Save(ConfigurationSaveMode.Minimal); } catch (Exception ex) { // config may be edited in the file (manually) - we cannot show an error dialog here // because it's entirely reasonable that the user doesn't have access to the machine running // the exe, in order to close a dialog _log.Error(ex.Message, ex); } }
public void StoreValues(Data data, string path) { AttachmentPage.StoreValues(data, path + @"AttachmentPage\"); AutoSave.StoreValues(data, path + @"AutoSave\"); BackgroundPage.StoreValues(data, path + @"BackgroundPage\"); CoverPage.StoreValues(data, path + @"CoverPage\"); CustomScript.StoreValues(data, path + @"CustomScript\"); DropboxSettings.StoreValues(data, path + @"DropboxSettings\"); EmailClientSettings.StoreValues(data, path + @"EmailClientSettings\"); EmailSmtpSettings.StoreValues(data, path + @"EmailSmtpSettings\"); Ftp.StoreValues(data, path + @"Ftp\"); Ghostscript.StoreValues(data, path + @"Ghostscript\"); HttpSettings.StoreValues(data, path + @"HttpSettings\"); JpegSettings.StoreValues(data, path + @"JpegSettings\"); PdfSettings.StoreValues(data, path + @"PdfSettings\"); PngSettings.StoreValues(data, path + @"PngSettings\"); Printing.StoreValues(data, path + @"Printing\"); Properties.StoreValues(data, path + @"Properties\"); Scripting.StoreValues(data, path + @"Scripting\"); Stamping.StoreValues(data, path + @"Stamping\"); TextSettings.StoreValues(data, path + @"TextSettings\"); TiffSettings.StoreValues(data, path + @"TiffSettings\"); UserTokens.StoreValues(data, path + @"UserTokens\"); data.SetValue(@"" + path + @"AuthorTemplate", Data.EscapeString(AuthorTemplate)); data.SetValue(@"" + path + @"FileNameTemplate", Data.EscapeString(FileNameTemplate)); data.SetValue(@"" + path + @"Guid", Data.EscapeString(Guid)); data.SetValue(@"" + path + @"KeywordTemplate", Data.EscapeString(KeywordTemplate)); data.SetValue(@"" + path + @"Name", Data.EscapeString(Name)); data.SetValue(@"" + path + @"OpenViewer", OpenViewer.ToString()); data.SetValue(@"" + path + @"OpenWithPdfArchitect", OpenWithPdfArchitect.ToString()); data.SetValue(@"" + path + @"OutputFormat", OutputFormat.ToString()); data.SetValue(@"" + path + @"ShowAllNotifications", ShowAllNotifications.ToString()); data.SetValue(@"" + path + @"ShowOnlyErrorNotifications", ShowOnlyErrorNotifications.ToString()); data.SetValue(@"" + path + @"ShowProgress", ShowProgress.ToString()); data.SetValue(@"" + path + @"ShowQuickActions", ShowQuickActions.ToString()); data.SetValue(@"" + path + @"SkipPrintDialog", SkipPrintDialog.ToString()); data.SetValue(@"" + path + @"SubjectTemplate", Data.EscapeString(SubjectTemplate)); data.SetValue(@"" + path + @"TargetDirectory", Data.EscapeString(TargetDirectory)); data.SetValue(@"" + path + @"TitleTemplate", Data.EscapeString(TitleTemplate)); }
public XmlNode GenerateXML() { // Create XML Node and Attributes XmlDocument d = new XmlDocument(); XmlNode output = d.CreateNode("element", "Action", null); XmlAttribute type = d.CreateAttribute("Type"); XmlAttribute showProgress = d.CreateAttribute("ShowProgress"); XmlAttribute valueTypes = d.CreateAttribute("ValueTypes"); XmlAttribute condition = d.CreateAttribute("Condition"); // Assign attribute values type.Value = "DefaultValues"; showProgress.Value = ShowProgress.ToString(); valueTypes.Value = GenerateValueTypes(); condition.Value = Condition; // Append Attributes output.Attributes.Append(type); if (null != ShowProgress) { output.Attributes.Append(showProgress); } output.Attributes.Append(valueTypes); if (!string.IsNullOrEmpty(Condition)) { output.Attributes.Append(condition); } // Append Children foreach (IChildElement input in SubChildren) { XmlNode importNode = d.ImportNode(input.GenerateXML(), true); output.AppendChild(importNode); } return(output); }