/*public void ClearASCompletion(IMainForm mainForm) { mainForm.CallCommand("PluginCommand",COMMAND_CLEARCLASSCACHE); }*/ #endregion #region Project File Reference Updating public void RemoveAllReferences(Project project, string path) { if (project.IsLibraryAsset(path)) project.SetLibraryAsset(path,false); if (project.IsCompileTarget(path)) project.SetCompileTarget(path,false); }
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}); } }