public void ReadValues(Data data, string path) { AttachmentPage.ReadValues(data, path + @"AttachmentPage\"); AutoSave.ReadValues(data, path + @"AutoSave\"); BackgroundPage.ReadValues(data, path + @"BackgroundPage\"); CoverPage.ReadValues(data, path + @"CoverPage\"); CustomScript.ReadValues(data, path + @"CustomScript\"); DropboxSettings.ReadValues(data, path + @"DropboxSettings\"); EmailClientSettings.ReadValues(data, path + @"EmailClientSettings\"); EmailSmtpSettings.ReadValues(data, path + @"EmailSmtpSettings\"); ForwardToFurtherProfile.ReadValues(data, path + @"ForwardToFurtherProfile\"); Ftp.ReadValues(data, path + @"Ftp\"); Ghostscript.ReadValues(data, path + @"Ghostscript\"); HttpSettings.ReadValues(data, path + @"HttpSettings\"); JpegSettings.ReadValues(data, path + @"JpegSettings\"); PdfSettings.ReadValues(data, path + @"PdfSettings\"); PngSettings.ReadValues(data, path + @"PngSettings\"); Printing.ReadValues(data, path + @"Printing\"); Properties.ReadValues(data, path + @"Properties\"); Scripting.ReadValues(data, path + @"Scripting\"); Stamping.ReadValues(data, path + @"Stamping\"); TextSettings.ReadValues(data, path + @"TextSettings\"); TiffSettings.ReadValues(data, path + @"TiffSettings\"); UserTokens.ReadValues(data, path + @"UserTokens\"); Watermark.ReadValues(data, path + @"Watermark\"); try{ int numClasses = int.Parse(data.GetValue(@"" + path + @"ActionOrder\numClasses")); for (int i = 0; i < numClasses; i++) { try{ var value = Data.UnescapeString(data.GetValue(path + @"ActionOrder\" + i + @"\ActionOrder")); ActionOrder.Add(value); }catch {} } }catch {} try { AuthorTemplate = Data.UnescapeString(data.GetValue(@"" + path + @"AuthorTemplate")); } catch { AuthorTemplate = "<PrintJobAuthor>"; } EnableWorkflowEditor = bool.TryParse(data.GetValue(@"" + path + @"EnableWorkflowEditor"), out var tmpEnableWorkflowEditor) ? tmpEnableWorkflowEditor : true; try { FileNameTemplate = Data.UnescapeString(data.GetValue(@"" + path + @"FileNameTemplate")); } catch { FileNameTemplate = "<Title>"; } try { Guid = Data.UnescapeString(data.GetValue(@"" + path + @"Guid")); } catch { Guid = ""; } try { KeywordTemplate = Data.UnescapeString(data.GetValue(@"" + path + @"KeywordTemplate")); } catch { KeywordTemplate = ""; } try { Name = Data.UnescapeString(data.GetValue(@"" + path + @"Name")); } catch { Name = "NewProfile"; } OpenViewer = bool.TryParse(data.GetValue(@"" + path + @"OpenViewer"), out var tmpOpenViewer) ? tmpOpenViewer : true; OpenWithPdfArchitect = bool.TryParse(data.GetValue(@"" + path + @"OpenWithPdfArchitect"), out var tmpOpenWithPdfArchitect) ? tmpOpenWithPdfArchitect : true; OutputFormat = Enum.TryParse <OutputFormat>(data.GetValue(@"" + path + @"OutputFormat"), out var tmpOutputFormat) ? tmpOutputFormat : OutputFormat.Pdf; SaveFileTemporary = bool.TryParse(data.GetValue(@"" + path + @"SaveFileTemporary"), out var tmpSaveFileTemporary) ? tmpSaveFileTemporary : false; ShowAllNotifications = bool.TryParse(data.GetValue(@"" + path + @"ShowAllNotifications"), out var tmpShowAllNotifications) ? tmpShowAllNotifications : true; ShowOnlyErrorNotifications = bool.TryParse(data.GetValue(@"" + path + @"ShowOnlyErrorNotifications"), out var tmpShowOnlyErrorNotifications) ? tmpShowOnlyErrorNotifications : false; ShowProgress = bool.TryParse(data.GetValue(@"" + path + @"ShowProgress"), out var tmpShowProgress) ? tmpShowProgress : true; ShowQuickActions = bool.TryParse(data.GetValue(@"" + path + @"ShowQuickActions"), out var tmpShowQuickActions) ? tmpShowQuickActions : true; SkipPrintDialog = bool.TryParse(data.GetValue(@"" + path + @"SkipPrintDialog"), out var tmpSkipPrintDialog) ? tmpSkipPrintDialog : false; try { SubjectTemplate = Data.UnescapeString(data.GetValue(@"" + path + @"SubjectTemplate")); } catch { SubjectTemplate = ""; } try { TargetDirectory = Data.UnescapeString(data.GetValue(@"" + path + @"TargetDirectory")); } catch { TargetDirectory = ""; } try { TitleTemplate = Data.UnescapeString(data.GetValue(@"" + path + @"TitleTemplate")); } catch { TitleTemplate = "<PrintJobName>"; } }
public void ReplaceWith(ConversionProfile source) { AttachmentPage.ReplaceWith(source.AttachmentPage); AutoSave.ReplaceWith(source.AutoSave); BackgroundPage.ReplaceWith(source.BackgroundPage); CoverPage.ReplaceWith(source.CoverPage); CustomScript.ReplaceWith(source.CustomScript); DropboxSettings.ReplaceWith(source.DropboxSettings); EmailClientSettings.ReplaceWith(source.EmailClientSettings); EmailSmtpSettings.ReplaceWith(source.EmailSmtpSettings); ForwardToFurtherProfile.ReplaceWith(source.ForwardToFurtherProfile); Ftp.ReplaceWith(source.Ftp); Ghostscript.ReplaceWith(source.Ghostscript); HttpSettings.ReplaceWith(source.HttpSettings); JpegSettings.ReplaceWith(source.JpegSettings); PdfSettings.ReplaceWith(source.PdfSettings); PngSettings.ReplaceWith(source.PngSettings); Printing.ReplaceWith(source.Printing); Properties.ReplaceWith(source.Properties); Scripting.ReplaceWith(source.Scripting); Stamping.ReplaceWith(source.Stamping); TextSettings.ReplaceWith(source.TextSettings); TiffSettings.ReplaceWith(source.TiffSettings); UserTokens.ReplaceWith(source.UserTokens); Watermark.ReplaceWith(source.Watermark); ActionOrder.Clear(); for (int i = 0; i < source.ActionOrder.Count; i++) { ActionOrder.Add(source.ActionOrder[i]); } if (AuthorTemplate != source.AuthorTemplate) { AuthorTemplate = source.AuthorTemplate; } if (EnableWorkflowEditor != source.EnableWorkflowEditor) { EnableWorkflowEditor = source.EnableWorkflowEditor; } if (FileNameTemplate != source.FileNameTemplate) { FileNameTemplate = source.FileNameTemplate; } if (Guid != source.Guid) { Guid = source.Guid; } if (KeywordTemplate != source.KeywordTemplate) { KeywordTemplate = source.KeywordTemplate; } if (Name != source.Name) { Name = source.Name; } if (OpenViewer != source.OpenViewer) { OpenViewer = source.OpenViewer; } if (OpenWithPdfArchitect != source.OpenWithPdfArchitect) { OpenWithPdfArchitect = source.OpenWithPdfArchitect; } if (OutputFormat != source.OutputFormat) { OutputFormat = source.OutputFormat; } if (SaveFileTemporary != source.SaveFileTemporary) { SaveFileTemporary = source.SaveFileTemporary; } if (ShowAllNotifications != source.ShowAllNotifications) { ShowAllNotifications = source.ShowAllNotifications; } if (ShowOnlyErrorNotifications != source.ShowOnlyErrorNotifications) { ShowOnlyErrorNotifications = source.ShowOnlyErrorNotifications; } if (ShowProgress != source.ShowProgress) { ShowProgress = source.ShowProgress; } if (ShowQuickActions != source.ShowQuickActions) { ShowQuickActions = source.ShowQuickActions; } if (SkipPrintDialog != source.SkipPrintDialog) { SkipPrintDialog = source.SkipPrintDialog; } if (SubjectTemplate != source.SubjectTemplate) { SubjectTemplate = source.SubjectTemplate; } if (TargetDirectory != source.TargetDirectory) { TargetDirectory = source.TargetDirectory; } if (TitleTemplate != source.TitleTemplate) { TitleTemplate = source.TitleTemplate; } }