public SoftProofingConfigDialog() { UI.InitScaling(this); InitializeComponent(); this.inputProfile = null; this.displayProfile = null; this.proofingColorProfiles = new ColorProfileInfoCollection(); this.xmlSettings = new XMLSettingsContainer(); this.destinationProfileTempPath = null; }
private void LoadSettings() { string userDataPath = Services.GetService <PaintDotNet.AppModel.IAppInfoService>().UserDataDirectory; if (!Directory.Exists(userDataPath)) { Directory.CreateDirectory(userDataPath); } string path = Path.Combine(userDataPath, "SoftProofingSettings.xml"); try { using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) { XmlSerializer serializer = new XmlSerializer(typeof(XMLSettingsContainer)); this.xmlSettings = (XMLSettingsContainer)serializer.Deserialize(fs); } // Check to make sure that the dialog has not already been initialized from the token. if (this.xmlSettings.InputProfile != null && this.inputProfile == null) { this.inputProfile = this.xmlSettings.InputProfile; } if (this.xmlSettings.DisplayProfile != null && this.displayProfile == null) { this.displayProfile = this.xmlSettings.DisplayProfile; } if (this.xmlSettings.ProofingProfiles != null && this.proofingColorProfiles.Count == 0) { foreach (var profile in this.xmlSettings.ProofingProfiles) { if (File.Exists(profile.Path)) { this.proofingColorProfiles.Add(profile); } } for (int i = 0; i < this.proofingColorProfiles.Count; i++) { this.proofingProfilesCombo.Items.Add(this.proofingColorProfiles[i].Description); } } } catch (FileNotFoundException) { } }