/// <summary> /// Creates a new project and clears the controls. /// </summary> private void NewProjectButtonClick(Object sender, EventArgs e) { this.saveFileDialog.FileName = "Untitled.docproj"; this.activeProject = new Project(); this.pageTitleTextBox.Text = ""; this.packagesTextBox.Text = ""; this.outputDirTextBox.Text = ""; this.classpathListBox.Items.Clear(); this.compilerComboBox.SelectedIndex = 0; this.extraOptionsTextBox.Text = ""; this.ProjectIsModified = false; this.tabControl.SelectedTab = this.projectTabPage; }
/// <summary> /// Browses for a project to be opened. /// </summary> private void OpenProjectButtonClick(Object sender, EventArgs e) { if (this.openFileDialog.ShowDialog() == DialogResult.OK) { String file = this.openFileDialog.FileName; Object project = ObjectSerializer.Deserialize(file, this.activeProject); this.activeProject = (Project)project; this.UpdateProjectToDialog(); this.ProjectIsModified = false; this.saveFileDialog.FileName = this.openFileDialog.FileName; this.tabControl.SelectedTab = this.projectTabPage; } }
/// <summary> /// Processes the incoming arguments /// </summary> private void ProcessStartArguments() { foreach (String argument in this.arguments) { if (File.Exists(argument) && argument.EndsWith(".docproj")) { String file = Path.GetFullPath(argument); Object project = ObjectSerializer.Deserialize(file, this.activeProject); this.activeProject = (Project)project; this.UpdateProjectToDialog(); this.ProjectIsModified = false; this.saveFileDialog.FileName = this.openFileDialog.FileName = file; this.tabControl.SelectedTab = this.projectTabPage; return; } } }
/// <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 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: 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); } }