public static Project Create(string path) { Project project = new Project(path); // default values project.OutputPath = project.Name + ".swf"; project.Classpaths.Add("."); project.Save(); return project; }
public void ToggleHidden(Project project, string[] paths) { foreach (string path in paths) { bool isHidden = project.IsPathHidden(path); project.SetPathHidden(path, !isHidden); } project.Save(); OnProjectModified(null); }
public void ToggleAlwaysCompile(Project project, string[] paths) { foreach (string path in paths) { bool isTarget = project.IsCompileTarget(path); project.SetCompileTarget(path, !isTarget); } project.Save(); OnProjectModified(paths); }
public void ToggleShowHidden(Project project) { project.ShowHiddenPaths = !project.ShowHiddenPaths; project.Save(); OnProjectModified(null); }
public void ToggleLibraryAsset(Project project, string[] paths) { foreach (string path in paths) { bool isResource = project.IsLibraryAsset(path); project.SetLibraryAsset(path, !isResource); } project.Save(); OnProjectModified(paths); }
public void AddLibraryAsset(Project project, string inDirectory) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Add Library Asset"; dialog.Filter = "All files (*.*)|*.*"; dialog.Multiselect = false; if (dialog.ShowDialog() == DialogResult.OK) { string filePath = CopyFile(dialog.FileName,inDirectory); // null means the user cancelled if (filePath == null) return; // add as an asset project.SetLibraryAsset(filePath,true); // ask if you want to keep this file updated string caption = "FlashDevelop"; string message = "Would you like to keep this file updated from the source " + "location? (You can always change this in the 'Options' context menu)"; DialogResult result = MessageBox.Show(owner,message,caption, MessageBoxButtons.YesNo,MessageBoxIcon.Question); if (result == DialogResult.Yes) { LibraryAsset asset = project.GetAsset(filePath); asset.UpdatePath = project.GetRelativePath(dialog.FileName); } project.Save(); OnProjectModified(new string[]{filePath}); } }