Beispiel #1
0
		public void Initialize()
		{
            LoadSettings();
            pluginImage = MainForm.FindImage("100");
            pluginDesc = TextHelper.GetString("Info.Description");
            openFileQueue = new Queue<String>();

            Icons.Initialize(MainForm);
            EventManager.AddEventHandler(this, eventMask);

            showProjectClasspaths = Settings.ShowProjectClasspaths;
            showGlobalClasspaths = Settings.ShowGlobalClasspaths;

            #region Actions and Event Listeners

            menus = new FDMenus(MainForm);
            menus.ProjectMenu.ProjectItemsEnabled = false;
            menus.TestMovie.Enabled = false;
            menus.TestMovie.Click += delegate { TestMovie(); };
            menus.BuildProject.Enabled = false;
            menus.BuildProject.Click += delegate { BuildProject(); };
            menus.View.Click += delegate { OpenPanel(); };
            menus.GlobalClasspaths.Click += delegate { OpenGlobalClasspaths(); };
            menus.ConfigurationSelector.SelectedIndexChanged += delegate 
            {
                bool isDebug = menus.ConfigurationSelector.Text == TextHelper.GetString("Info.Debug");
                FlexCompilerShell.Cleanup();
                pluginUI.IsTraceDisabled = !isDebug;
                Project project = activeProject;
                if (project != null) project.TraceEnabled = isDebug;
            };
            menus.TargetBuildSelector.KeyDown += new KeyEventHandler(TargetBuildSelector_KeyDown);
            menus.TargetBuildSelector.SelectedIndexChanged += delegate { ApplyTargetBuild(); };
            menus.TargetBuildSelector.LostFocus += delegate { ApplyTargetBuild(); };
            
            menus.ProjectMenu.NewProject.Click += delegate { NewProject(); };
            menus.ProjectMenu.OpenProject.Click += delegate { OpenProject(); };
            menus.ProjectMenu.ImportProject.Click += delegate { ImportProject(); };
            menus.ProjectMenu.CloseProject.Click += delegate { CloseProject(false); };
            menus.ProjectMenu.OpenResource.Click += delegate { OpenResource(); };
            menus.ProjectMenu.TestMovie.Click += delegate { TestMovie(); };
            menus.ProjectMenu.RunProject.Click += delegate { RunProject(); };
            menus.ProjectMenu.BuildProject.Click += delegate { BuildProject(); };
            menus.ProjectMenu.CleanProject.Click += delegate { CleanProject(); };
            menus.ProjectMenu.Properties.Click += delegate { OpenProjectProperties(); };
            menus.RecentProjects.ProjectSelected += delegate(string projectPath) { OpenProjectSilent(projectPath); };

            buildActions = new BuildActions(MainForm,menus);
            buildActions.BuildComplete += BuildComplete;
            buildActions.BuildFailed += BuildFailed;

            flashDevelopActions = new FlashDevelopActions(MainForm);

            fileActions = new FileActions(MainForm,flashDevelopActions);
            fileActions.OpenFile += OpenFile;
            fileActions.FileDeleted += FileDeleted;
            fileActions.FileMoved += FileMoved;
            fileActions.FileCopied += FilePasted;

            projectActions = new ProjectActions(pluginUI);

            pluginUI = new PluginUI(this, menus, fileActions, projectActions);
            pluginUI.NewProject += delegate { NewProject(); };
            pluginUI.OpenProject += delegate { OpenProject(); };
            pluginUI.ImportProject += delegate { ImportProject(); };
            pluginUI.Rename += fileActions.Rename;
            pluginUI.TreeBar.ShowHidden.Click += delegate { ToggleShowHidden(); };
            pluginUI.TreeBar.Synchronize.Click += delegate { TreeSyncToCurrentFile(); };
            pluginUI.TreeBar.SynchronizeMain.Click += delegate { TreeSyncToMainFile(); };
            pluginUI.TreeBar.ProjectProperties.Click += delegate { OpenProjectProperties(); };
            pluginUI.TreeBar.RefreshSelected.Click += delegate { TreeRefreshSelectedNode(); };
            pluginUI.TreeBar.ProjectTypes.Click += delegate 
            {
                DataEvent de = new DataEvent(EventType.Command, "ASCompletion.TypesExplorer", null);
                EventManager.DispatchEvent(this, de);
            };

            pluginUI.Menu.Open.Click += delegate { TreeOpenItems(); };
            pluginUI.Menu.Execute.Click += delegate { TreeExecuteItems(); };
            pluginUI.Menu.Insert.Click += delegate { TreeInsertItem(); };
            pluginUI.Menu.AddLibrary.Click += delegate { TreeAddLibraryItems(); };
            pluginUI.Menu.AlwaysCompile.Click += delegate { TreeAlwaysCompileItems(); };
            pluginUI.Menu.SetDocumentClass.Click += delegate { TreeDocumentClass(); };
            pluginUI.Menu.DocumentClass.Click += delegate { TreeDocumentClass(); };
            pluginUI.Menu.Browse.Click += delegate { TreeBrowseItem(); };
            pluginUI.Menu.Cut.Click += delegate { TreeCutItems(); };
            pluginUI.Menu.Copy.Click += delegate { TreeCopyItems(); };
            pluginUI.Menu.Paste.Click += delegate { TreePasteItems(); };
            pluginUI.Menu.Delete.Click += delegate { TreeDeleteItems(); };
            pluginUI.Menu.LibraryOptions.Click += delegate { TreeLibraryOptions(); };
            pluginUI.Menu.HideItem.Click += delegate { TreeHideItems(); };
            pluginUI.Menu.ShowHidden.Click += delegate { ToggleShowHidden(); };
            pluginUI.Menu.AddFileFromTemplate += TreeAddFileFromTemplate;
            pluginUI.Menu.AddNewFolder.Click += delegate { TreeAddFolder(); };
            pluginUI.Menu.AddLibraryAsset.Click += delegate { TreeAddAsset(); };
            pluginUI.Menu.AddExistingFile.Click += delegate { TreeAddExistingFile(); };
            pluginUI.Menu.TestMovie.Click += delegate { TestMovie(); };
            pluginUI.Menu.BuildProject.Click += delegate { 
                BuildProject(); 
            };
            pluginUI.Menu.CloseProject.Click += delegate { CloseProject(false); };
            pluginUI.Menu.Properties.Click += delegate { OpenProjectProperties(); };
            pluginUI.Menu.ShellMenu.Click += delegate { TreeShowShellMenu(); };
            pluginUI.Menu.CommandPrompt.Click += delegate { TreeShowCommandPrompt(); };
            pluginUI.Menu.BuildProjectFile.Click += delegate { BackgroundBuild(); };
            pluginUI.Menu.BuildProjectFiles.Click += delegate { BackgroundBuild(); };
            pluginUI.Menu.BuildAllProjects.Click += delegate { FullBuild(); };
            pluginUI.Menu.TestAllProjects.Click += delegate { TestBuild(); };
            pluginUI.Menu.FindAndReplace.Click += delegate { FindAndReplace(); };
            pluginUI.Menu.FindInFiles.Click += delegate { FindInFiles(); };
            pluginUI.Menu.CopyClassName.Click += delegate { CopyClassName(); };
            pluginUI.Menu.AddSourcePath.Click += delegate { AddSourcePath(); };
            pluginUI.Menu.RemoveSourcePath.Click += delegate { RemoveSourcePath(); };
            pluginUI.Menu.Opening += new CancelEventHandler(this.MenuOpening);

            Tree.MovePath += fileActions.Move;
            Tree.CopyPath += fileActions.Copy;
            Tree.DoubleClick += delegate { TreeDoubleClick(); };

            #endregion

            pluginPanel = MainForm.CreateDockablePanel(pluginUI, Guid, Icons.Project.Img, DockState.DockRight);
            buildQueue = new Queue<String>();
            buildTimer = new Timer();
            buildTimer.Interval = 500;
            buildTimer.Tick += new EventHandler(OnBuildTimerTick);
            buildingAll = false;
            runOutput = false;
        }
Beispiel #2
0
        public void Initialize()
        {
            LoadSettings();
            pluginImage   = MainForm.FindImage("100");
            pluginDesc    = TextHelper.GetString("Info.Description");
            openFileQueue = new Queue <String>();

            Icons.Initialize(MainForm);
            EventManager.AddEventHandler(this, eventMask);

            #region Actions and Event Listeners

            menus = new FDMenus(MainForm);
            menus.ProjectMenu.ProjectItemsEnabled = false;
            menus.View.Click         += delegate { OpenPanel(); };
            menus.DebugProject.Click += delegate { DebugProject(); };

            menus.ProjectMenu.NewProject.Click   += delegate { NewProject(); };
            menus.ProjectMenu.OpenProject.Click  += delegate { OpenProject(); };
            menus.ProjectMenu.CloseProject.Click += delegate { CloseProject(false); };
            menus.ProjectMenu.OpenResource.Click += delegate { OpenResource(); };
            menus.ProjectMenu.DebugProject.Click += delegate { DebugProject(); };
            menus.ProjectMenu.Properties.Click   += delegate { OpenProjectProperties(); };
            menus.RecentProjects.ProjectSelected += delegate(string projectPath) { OpenProjectSilent(projectPath); };

            LuaDevelopActions = new LuaDevelopActions(MainForm);

            fileActions              = new FileActions(MainForm, LuaDevelopActions);
            fileActions.OpenFile    += OpenFile;
            fileActions.FileDeleted += FileDeleted;
            fileActions.FileMoved   += FileMoved;
            fileActions.FileCopied  += FilePasted;

            projectActions = new ProjectActions(pluginUI);

            pluginUI              = new PluginUI(this, menus, fileActions, projectActions);
            pluginUI.NewProject  += delegate { NewProject(); };
            pluginUI.OpenProject += delegate { OpenProject(); };
            pluginUI.Rename      += fileActions.Rename;
            pluginUI.TreeBar.ShowHidden.Click        += delegate { ToggleShowHidden(); };
            pluginUI.TreeBar.Synchronize.Click       += delegate { TreeSyncToCurrentFile(); };
            pluginUI.TreeBar.ProjectProperties.Click += delegate { OpenProjectProperties(); };
            pluginUI.TreeBar.RefreshSelected.Click   += delegate { TreeRefreshSelectedNode(); };

            pluginUI.Menu.Open.Click            += delegate { TreeOpenItems(); };
            pluginUI.Menu.Execute.Click         += delegate { TreeExecuteItems(); };
            pluginUI.Menu.Browse.Click          += delegate { TreeBrowseItem(); };
            pluginUI.Menu.Cut.Click             += delegate { TreeCutItems(); };
            pluginUI.Menu.Copy.Click            += delegate { TreeCopyItems(); };
            pluginUI.Menu.Paste.Click           += delegate { TreePasteItems(); };
            pluginUI.Menu.Delete.Click          += delegate { TreeDeleteItems(); };
            pluginUI.Menu.HideItem.Click        += delegate { TreeHideItems(); };
            pluginUI.Menu.ShowHidden.Click      += delegate { ToggleShowHidden(); };
            pluginUI.Menu.AddFileFromTemplate   += TreeAddFileFromTemplate;
            pluginUI.Menu.AddNewFolder.Click    += delegate { TreeAddFolder(); };
            pluginUI.Menu.AddExistingFile.Click += delegate { TreeAddExistingFile(); };
            pluginUI.Menu.DebugProject.Click    += delegate { DebugProject(); };
            pluginUI.Menu.CloseProject.Click    += delegate { CloseProject(false); };
            pluginUI.Menu.Properties.Click      += delegate { OpenProjectProperties(); };
            pluginUI.Menu.ShellMenu.Click       += delegate { TreeShowShellMenu(); };
            pluginUI.Menu.CommandPrompt.Click   += delegate { TreeShowCommandPrompt(); };
            pluginUI.Menu.FindAndReplace.Click  += delegate { FindAndReplace(); };
            pluginUI.Menu.FindInFiles.Click     += delegate { FindInFiles(); };
            pluginUI.Menu.Opening += new CancelEventHandler(this.MenuOpening);

            Tree.MovePath    += fileActions.Move;
            Tree.CopyPath    += fileActions.Copy;
            Tree.DoubleClick += delegate { TreeDoubleClick(); };

            #endregion

            pluginPanel = MainForm.CreateDockablePanel(pluginUI, Guid, Icons.Project.Img, DockState.DockRight);
        }