/// <summary> /// Loads the application settings from the setting file. /// </summary> private void LoadSettings() { this.appSettings = new Settings(); this.activeProject = new Project(); String settingFile = Path.Combine(this.SettingDir, "Settings.xml"); if (File.Exists(settingFile)) { Object settings = ObjectSerializer.Deserialize(settingFile, this.appSettings); this.appSettings = (Settings)settings; } // Try to find asdoc path from: AppMan's Apps or FD/Tools/flexsdk/ if (String.IsNullOrEmpty(this.appSettings.asdocLocation)) { try { this.appSettings.asdocLocation = DetectSDKLocation(); } catch {} } if (!File.Exists(settingFile)) { ObjectSerializer.Serialize(settingFile, this.appSettings); } }
/// <summary> /// Loads the application settings from the setting file. /// </summary> private void LoadSettings() { this.appSettings = new Settings(); this.activeProject = new Project(); String settingFile = Path.Combine(this.SettingDir, "Settings.xml"); if (File.Exists(settingFile)) { Object settings = ObjectSerializer.Deserialize(settingFile, this.appSettings); this.appSettings = (Settings)settings; } // Try to find asdoc path from: Tools/flexsdk/ if (String.IsNullOrEmpty(this.appSettings.asdocLocation)) { String parentDir = Directory.GetParent(this.AppDir).FullName; String asdocPath = Path.Combine(parentDir, @"flexsdk\bin\asdoc.exe"); String asdocPath2 = Path.Combine(parentDir, @"flexsdk\bin\asdoc.bat"); if (File.Exists(asdocPath)) { this.appSettings.asdocLocation = Path.GetDirectoryName(asdocPath); ObjectSerializer.Serialize(settingFile, this.appSettings); } if (File.Exists(asdocPath2)) { this.appSettings.asdocLocation = Path.GetDirectoryName(asdocPath2); ObjectSerializer.Serialize(settingFile, this.appSettings); } } if (!File.Exists(settingFile)) { ObjectSerializer.Serialize(settingFile, this.appSettings); } }
/// <summary> /// Loads the application settings from the setting file. /// </summary> private void LoadSettings() { this.appSettings = new Settings(); this.activeProject = new Project(); String settingFile = Path.Combine(this.SettingDir, "Settings.xml"); if (File.Exists(settingFile)) { Object settings = ObjectSerializer.Deserialize(settingFile, this.appSettings); this.appSettings = (Settings)settings; } // Try to find asdoc path from: AppMan's Archive or FD/Tools/flexsdk/ if (String.IsNullOrEmpty(this.appSettings.asdocLocation)) { String curSDK = String.Empty; String asdocPath = String.Empty; String asdocPath2 = String.Empty; String parentDir = Directory.GetParent(this.AppDir).FullName; String userAppDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); String appManDir = Path.Combine(userAppDir, @"FlashDevelop\Data\AppMan\Archive\flexsdk"); if (Directory.Exists(appManDir)) { String[] versionDirs = Directory.GetDirectories(appManDir); foreach (string versionDir in versionDirs) { if (Directory.Exists(versionDir)) { asdocPath = Path.Combine(versionDir, @"bin\asdoc.exe"); asdocPath2 = Path.Combine(versionDir, @"bin\asdoc.bat"); if (File.Exists(asdocPath)) curSDK = asdocPath; if (File.Exists(asdocPath2)) curSDK = asdocPath2; } } } asdocPath = Path.Combine(parentDir, @"flexsdk\bin\asdoc.exe"); asdocPath2 = Path.Combine(parentDir, @"flexsdk\bin\asdoc.bat"); if (File.Exists(asdocPath)) curSDK = Path.GetDirectoryName(asdocPath); if (File.Exists(asdocPath2)) curSDK = Path.GetDirectoryName(asdocPath2); this.appSettings.asdocLocation = Path.GetDirectoryName(curSDK); } if (!File.Exists(settingFile)) { ObjectSerializer.Serialize(settingFile, this.appSettings); } }