public FileActions(IWin32Window owner) { this.fdActions = new FlashDevelopActions(PluginMain.MainFormRef); this.DocumentSeekRequest = 0; this.owner = owner; }
public void Initialize() { MainFormRef = MainForm; // Mika: added Icons.Initialize(MainForm); Settings.Initialize(MainForm); PluginData.Load(); showProjectClasspaths = Settings.ShowProjectClasspaths; showGlobalClasspaths = Settings.ShowGlobalClasspaths; MainForm.IgnoredKeys.Add(Keys.F5); MainForm.IgnoredKeys.Add(Keys.F8); #region Actions and Event Listeners menus = new FDMenus(MainForm); menus.View.Click += new EventHandler(OpenPanel); menus.GlobalClasspaths.Click += new EventHandler(OpenGlobalClasspaths); menus.ProjectMenu.NewProject.Click += new EventHandler(NewProject); menus.ProjectMenu.OpenProject.Click += new EventHandler(OpenProject); menus.ProjectMenu.CloseProject.Click += new EventHandler(CloseProject); menus.ProjectMenu.TestMovie.Click += new EventHandler(TestMovie); menus.ProjectMenu.BuildProject.Click += new EventHandler(BuildProject); menus.ProjectMenu.Properties.Click += new EventHandler(OpenProjectProperties); menus.RecentComboBox.RequestProject += new ProjectRequestHandler(GetProject); menus.RecentComboBox.OpenProject += new ProjectOpenHandler(OpenProjectSilent); buildActions = new BuildActions(MainForm); buildActions.BuildComplete += new BuildCompleteHandler(BuildComplete); buildActions.ClasspathsChanged += new EventHandler(ProjectClasspathsChanged); flashDevelopActions = new FlashDevelopActions(MainForm); fileActions = new FileActions(pluginUI); fileActions.OpenFile += new FileNameHandler(OpenFile); fileActions.FileDeleted += new FileNameHandler(FileDeleted); fileActions.FileMoved += new FileMovedHandler(FileMoved); projectActions = new ProjectActions(pluginUI); // create our UI surface and a docking panel for it pluginUI = new PluginUI(this,menus,fileActions,projectActions); pluginUI.NewProject += new EventHandler(NewProject); pluginUI.OpenProject += new EventHandler(OpenProject); pluginUI.Rename += new RenameEventHandler(fileActions.Rename); pluginUI.Tree.MovePath += new DragPathEventHandler(fileActions.Move); pluginUI.Tree.CopyPath += new DragPathEventHandler(fileActions.Copy); pluginUI.Menu.Open.Click += new EventHandler(TreeOpenItems); pluginUI.Menu.Execute.Click += new EventHandler(TreeExecuteItems); pluginUI.Menu.Insert.Click += new EventHandler(TreeInsertItem); pluginUI.Menu.AddLibrary.Click += new EventHandler(TreeAddLibraryItems); pluginUI.Menu.AlwaysCompile.Click += new EventHandler(TreeAlwaysCompileItems); pluginUI.Menu.Cut.Click += new EventHandler(TreeCutItems); pluginUI.Menu.Copy.Click += new EventHandler(TreeCopyItems); pluginUI.Menu.Paste.Click += new EventHandler(TreePasteItems); pluginUI.Menu.Delete.Click += new EventHandler(TreeDeleteItems); pluginUI.Menu.LibraryOptions.Click += new EventHandler(TreeLibraryOptions); pluginUI.Menu.Hide.Click += new EventHandler(TreeHideItems); pluginUI.Menu.ShowHidden.Click += new EventHandler(ToggleShowHidden); pluginUI.Menu.AddNewClass.Click += new EventHandler(TreeAddNewClass); pluginUI.Menu.AddNewXml.Click += new EventHandler(TreeAddXml); pluginUI.Menu.AddNewFile.Click += new EventHandler(TreeAddFile); pluginUI.Menu.AddNewFolder.Click += new EventHandler(TreeAddFolder); pluginUI.Menu.AddLibraryAsset.Click += new EventHandler(TreeAddAsset); pluginUI.Menu.AddExistingFile.Click += new EventHandler(TreeAddExistingFile); pluginUI.TreeBar.Refresh.Click += new EventHandler(TreeRefreshNode); menus.RecentComboBox.Rebuild(); #endregion pluginPanel = MainForm.CreateDockingPanel(pluginUI, Guid, Icons.Project.Img, DockState.DockRight); // try to open the last opened project string lastProject = Settings.LastProject; if (Settings.LastProject != "" && File.Exists(Settings.LastProject)) { OpenProjectSilent(lastProject); // if we open the last project right away, we need to give ASCompletion // some time before we can trust that it received our classpaths ok startupTimer = new Timer(); startupTimer.Tick += new EventHandler(ProjectClasspathsChanged); startupTimer.Interval = 1000; startupTimer.Start(); } else Project = null; try { ProjectIcon.Associate(); // make sure .fdp points to this instance of FD } catch(UnauthorizedAccessException) { // silent } catch(Exception) { // silent? } }