public void ReadValues(Data data, string path) { CompressColorAndGray.ReadValues(data, path + @"CompressColorAndGray\"); CompressMonochrome.ReadValues(data, path + @"CompressMonochrome\"); Security.ReadValues(data, path + @"Security\"); Signature.ReadValues(data, path + @"Signature\"); try { ColorModel = (ColorModel)Enum.Parse(typeof(ColorModel), data.GetValue(@"" + path + @"ColorModel")); } catch { ColorModel = ColorModel.Rgb; } try { DocumentView = (DocumentView)Enum.Parse(typeof(DocumentView), data.GetValue(@"" + path + @"DocumentView")); } catch { DocumentView = DocumentView.NoOutLineNoThumbnailImages; } try { PageOrientation = (PageOrientation)Enum.Parse(typeof(PageOrientation), data.GetValue(@"" + path + @"PageOrientation")); } catch { PageOrientation = PageOrientation.Automatic; } try { PageView = (PageView)Enum.Parse(typeof(PageView), data.GetValue(@"" + path + @"PageView")); } catch { PageView = PageView.OnePage; } try { ViewerStartsOnPage = int.Parse(data.GetValue(@"" + path + @"ViewerStartsOnPage"), System.Globalization.CultureInfo.InvariantCulture); } catch { ViewerStartsOnPage = 1; } }
public void ReadValues(Data data, string path = "") { CompressColorAndGray.ReadValues(data, path + @"CompressColorAndGray\"); CompressMonochrome.ReadValues(data, path + @"CompressMonochrome\"); Security.ReadValues(data, path + @"Security\"); Signature.ReadValues(data, path + @"Signature\"); ColorModel = Enum.TryParse <ColorModel>(data.GetValue(@"" + path + @"ColorModel"), out var tmpColorModel) ? tmpColorModel : ColorModel.Rgb; DocumentView = Enum.TryParse <DocumentView>(data.GetValue(@"" + path + @"DocumentView"), out var tmpDocumentView) ? tmpDocumentView : DocumentView.NoOutLineNoThumbnailImages; EnablePdfAValidation = bool.TryParse(data.GetValue(@"" + path + @"EnablePdfAValidation"), out var tmpEnablePdfAValidation) ? tmpEnablePdfAValidation : false; NoFonts = bool.TryParse(data.GetValue(@"" + path + @"NoFonts"), out var tmpNoFonts) ? tmpNoFonts : false; PageOrientation = Enum.TryParse <PageOrientation>(data.GetValue(@"" + path + @"PageOrientation"), out var tmpPageOrientation) ? tmpPageOrientation : PageOrientation.Automatic; PageView = Enum.TryParse <PageView>(data.GetValue(@"" + path + @"PageView"), out var tmpPageView) ? tmpPageView : PageView.OnePage; ViewerStartsOnPage = int.TryParse(data.GetValue(@"" + path + @"ViewerStartsOnPage"), System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out var tmpViewerStartsOnPage) ? tmpViewerStartsOnPage : 1; }