示例#1
0
 private void CreatePanel()
 {
     pluginIcon    = PluginBase.MainForm.FindImage("99");
     pluginUI      = new PluginUI(this);
     pluginUI.Text = TextHelper.GetString("Title.PluginPanel");
     pluginPanel   = PluginBase.MainForm.CreateDockablePanel(pluginUI, pluginGuid, pluginIcon, DockState.DockRight);
 }
示例#2
0
        /// <summary>
        /// Create node for a type (class or interface)
        /// - defer subnodes population to user selection
        /// </summary>
        /// <param name="nodes">In package</param>
        /// <param name="model">Model information</param>
        private void AddModel(TreeNodeCollection nodes, FileModel model)
        {
            if (model.Members != null)
            {
                PluginUI.AddMembers(nodes, model.Members);
            }

            if (model.Classes != null)
            {
                foreach (ClassModel aClass in model.Classes)
                {
                    if (aClass.IndexType == null)
                    {
                        TypeTreeNode node = new TypeTreeNode(aClass);
                        AddExplore(node);
                        allTypes.Add(node);
                        nodes.Add(node);
                    }
                }
            }
        }
示例#3
0
 /// <summary>
 /// Describe types on user selection
 /// </summary>
 /// <param name="node"></param>
 private void outlineTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e)
 {
     if (e.Node.Nodes.Count == 1 && e.Node.Nodes[0] is ExploreTreeNode)
     {
         outlineTreeView.BeginUpdate();
         try
         {
             e.Node.Nodes.Clear();
             ClassModel theClass = ResolveClass(e.Node);
             if (theClass.IsVoid())
             {
                 return;
             }
             PluginUI.AddMembers(e.Node.Nodes, SelectMembers(theClass.Members, FlagType.Variable));
             PluginUI.AddMembers(e.Node.Nodes, SelectMembers(theClass.Members, FlagType.Getter | FlagType.Setter));
             PluginUI.AddMembers(e.Node.Nodes, SelectMembers(theClass.Members, FlagType.Function));
         }
         finally
         {
             outlineTreeView.EndUpdate();
         }
     }
 }
示例#4
0
 private void CreatePanel()
 {
     pluginIcon = PluginBase.MainForm.FindImage("99");
     pluginUI = new PluginUI(this);
     pluginUI.Text = TextHelper.GetString("Title.PluginPanel");
     pluginPanel = PluginBase.MainForm.CreateDockablePanel(pluginUI, pluginGuid, pluginIcon, DockState.DockRight);
 }
示例#5
0
		private void SafeInit()
		{
			this.mainForm = this.pluginHost.MainForm;
			this.pluginUI = new PluginUI();
			System.Drawing.Image image = this.mainForm.GetSystemImage(46);
			/**
			*  Create panel
			*/
			this.pluginUI.Tag = "ActionScript";
			this.pluginUI.Text = "ActionScript";
			this.pluginPanel = mainForm.CreateDockingPanel(this.pluginUI, this.pluginGuid, image, DockState.DockRight);
			/**
			* Default shortcuts
			*/
			if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_CHECK))
				MainForm.MainSettings.AddValue(SETTING_SHORTCUT_CHECK, "F7");
			if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_BUILD))
				MainForm.MainSettings.AddValue(SETTING_SHORTCUT_BUILD, "CtrlF8");
			if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_GOTO))
				MainForm.MainSettings.AddValue(SETTING_SHORTCUT_GOTO, "F4");
			if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_BACK))
				MainForm.MainSettings.AddValue(SETTING_SHORTCUT_BACK, "ShiftF4");
			if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_CLEARCACHE))
				MainForm.MainSettings.AddValue(SETTING_SHORTCUT_CLEARCACHE, "CtrlF7");

			/**
			*  Create menu items
			*/
			menuItems = new ArrayList();
			CommandBarItem item;
			CommandBarMenu menu = mainForm.GetCBMenu("ViewMenu");
			menu.Items.AddButton(image, "&ActionScript Panel", new EventHandler(this.OpenPanel));
			Keys k;

			// tools items
			menu = this.mainForm.GetCBMenu("FlashToolsMenu");
			if (menu != null)
			{
				menu.Items.AddSeparator();

				// clear class cache
				k = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_CLEARCACHE);
				if (k != Keys.None) this.mainForm.IgnoredKeys.Add(k);
				else ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut ("+MainForm.MainSettings.GetValue(SETTING_SHORTCUT_CLEARCACHE)+")");
				menu.Items.AddButton("&Clear Class Cache", new EventHandler(this.ClearClassCache), k);

				// convert to intrinsic
				item = menu.Items.AddButton("Convert To &Intrinsic", new EventHandler(this.MakeIntrinsic));
				menuItems.Add(item);

				// check actionscript
				image = this.pluginUI.treeIcons.Images[11];
				k = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_CHECK);
				if (k != Keys.None) this.mainForm.IgnoredKeys.Add(k);
				else ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut ("+MainForm.MainSettings.GetValue(SETTING_SHORTCUT_CHECK)+")");
				item = menu.Items.AddButton(image, "Check &ActionScript", new EventHandler(this.CheckActionScript), k);
				menuItems.Add(item);

				// quick MTASC build
				image = this.pluginUI.treeIcons.Images[10];
				k = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_BUILD);
				if (k != Keys.None) this.mainForm.IgnoredKeys.Add(k);
				else ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut ("+MainForm.MainSettings.GetValue(SETTING_SHORTCUT_BUILD)+")");
				item = menu.Items.AddButton(image, "&Quick Build", new EventHandler(this.QuickBuild), k);
				menuItems.Add(item);
			}
			else ErrorHandler.ShowInfo("MainMenu Error: no 'FlashToolsMenu' group found");

			// toolbar items
			CommandBar toolbar = MainForm.GetCBToolbar();
			if (toolbar != null)
			{
				toolbar.Items.AddSeparator();
				// check
				image = this.pluginUI.treeIcons.Images[11];
				item = toolbar.Items.AddButton(image, "Check ActionScript", new EventHandler(this.CheckActionScript));
				menuItems.Add(item);

				// build
				image = this.pluginUI.treeIcons.Images[10];
				item = toolbar.Items.AddButton(image, "Quick Build", new EventHandler(this.QuickBuild));
				menuItems.Add(item);
			}

			// search items
			menu = this.mainForm.GetCBMenu("SearchMenu");
			if (menu != null)
			{
				menu.Items.AddSeparator();

				// goto back from declaration
				image = this.mainForm.GetSystemImage(18);
				k = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_BACK);
				if (k != Keys.None) this.mainForm.IgnoredKeys.Add(k);
				else ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut ("+MainForm.MainSettings.GetValue(SETTING_SHORTCUT_BACK)+")");
				item = menu.Items.AddButton(image, "&Back From Declaration", new EventHandler(this.BackDeclaration), k);
				menuItems.Add(item);

				// goto declaration
				image = this.mainForm.GetSystemImage(17);
				k = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_GOTO);
				if (k != Keys.None) this.mainForm.IgnoredKeys.Add(k);
				else ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut ("+MainForm.MainSettings.GetValue(SETTING_SHORTCUT_GOTO)+")");
				item = menu.Items.AddButton(image, "Goto &Declaration", new EventHandler(this.GotoDeclaration), k);
				menuItems.Add(item);
			}
			else ErrorHandler.ShowInfo("MainMenu Error: no 'SearchMenu' group found");

			/**
			*  Initialize completion context
			*/
			sciReferences = new ArrayList();
			ASContext.Init(this);
			UITools.OnCharAdded += new UITools.CharAddedHandler( OnChar );
			InfoTip.OnMouseHover += new InfoTip.MouseHoverHandler( OnMouseHover );
			UITools.OnTextChanged += new UITools.TextChangedHandler( ASContext.OnTextChanged );
			InfoTip.OnUpdateCallTip += new InfoTip.UpdateCallTipHandler( OnUpdateCallTip );
			this.mainForm.IgnoredKeys.Add(Keys.Control|Keys.Enter);
			this.mainForm.IgnoredKeys.Add(Keys.F1);

			/**
			*  Path to the Flash IDE
			*/
			if (!MainForm.MainSettings.HasKey(SETTING_MACROMEDIA_FLASHIDE))
			{
				string found = "";
				foreach(string flashexe in MACROMEDIA_FLASHIDE_PATH)
				{
					if (System.IO.File.Exists(flashexe)) {
						found = flashexe;
						break;
					}
				}
				MainForm.MainSettings.AddValue(SETTING_MACROMEDIA_FLASHIDE, found);
			}
		}
示例#6
0
        private void SafeInit()
        {
            this.mainForm = this.pluginHost.MainForm;
            this.pluginUI = new PluginUI();
            System.Drawing.Image image = this.mainForm.GetSystemImage(46);

            /**
             *  Create panel
             */
            this.pluginUI.Tag  = "ActionScript";
            this.pluginUI.Text = "ActionScript";
            this.pluginPanel   = mainForm.CreateDockingPanel(this.pluginUI, this.pluginGuid, image, DockState.DockRight);

            /**
             * Default shortcuts
             */
            if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_CHECK))
            {
                MainForm.MainSettings.AddValue(SETTING_SHORTCUT_CHECK, "F7");
            }
            if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_BUILD))
            {
                MainForm.MainSettings.AddValue(SETTING_SHORTCUT_BUILD, "CtrlF8");
            }
            if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_GOTO))
            {
                MainForm.MainSettings.AddValue(SETTING_SHORTCUT_GOTO, "F4");
            }
            if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_BACK))
            {
                MainForm.MainSettings.AddValue(SETTING_SHORTCUT_BACK, "ShiftF4");
            }
            if (!MainForm.MainSettings.HasKey(SETTING_SHORTCUT_CLEARCACHE))
            {
                MainForm.MainSettings.AddValue(SETTING_SHORTCUT_CLEARCACHE, "CtrlF7");
            }

            /**
             *  Create menu items
             */
            menuItems = new ArrayList();
            CommandBarItem item;
            CommandBarMenu menu = mainForm.GetCBMenu("ViewMenu");

            menu.Items.AddButton(image, "&ActionScript Panel", new EventHandler(this.OpenPanel));
            Keys k;

            // tools items
            menu = this.mainForm.GetCBMenu("FlashToolsMenu");
            if (menu != null)
            {
                menu.Items.AddSeparator();

                // clear class cache
                k = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_CLEARCACHE);
                if (k != Keys.None)
                {
                    this.mainForm.IgnoredKeys.Add(k);
                }
                else
                {
                    ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut (" + MainForm.MainSettings.GetValue(SETTING_SHORTCUT_CLEARCACHE) + ")");
                }
                menu.Items.AddButton("&Clear Class Cache", new EventHandler(this.ClearClassCache), k);

                // convert to intrinsic
                item = menu.Items.AddButton("Convert To &Intrinsic", new EventHandler(this.MakeIntrinsic));
                menuItems.Add(item);

                // check actionscript
                image = this.pluginUI.treeIcons.Images[11];
                k     = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_CHECK);
                if (k != Keys.None)
                {
                    this.mainForm.IgnoredKeys.Add(k);
                }
                else
                {
                    ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut (" + MainForm.MainSettings.GetValue(SETTING_SHORTCUT_CHECK) + ")");
                }
                item = menu.Items.AddButton(image, "Check &ActionScript", new EventHandler(this.CheckActionScript), k);
                menuItems.Add(item);

                // quick MTASC build
                image = this.pluginUI.treeIcons.Images[10];
                k     = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_BUILD);
                if (k != Keys.None)
                {
                    this.mainForm.IgnoredKeys.Add(k);
                }
                else
                {
                    ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut (" + MainForm.MainSettings.GetValue(SETTING_SHORTCUT_BUILD) + ")");
                }
                item = menu.Items.AddButton(image, "&Quick Build", new EventHandler(this.QuickBuild), k);
                menuItems.Add(item);
            }
            else
            {
                ErrorHandler.ShowInfo("MainMenu Error: no 'FlashToolsMenu' group found");
            }

            // toolbar items
            CommandBar toolbar = MainForm.GetCBToolbar();

            if (toolbar != null)
            {
                toolbar.Items.AddSeparator();
                // check
                image = this.pluginUI.treeIcons.Images[11];
                item  = toolbar.Items.AddButton(image, "Check ActionScript", new EventHandler(this.CheckActionScript));
                menuItems.Add(item);

                // build
                image = this.pluginUI.treeIcons.Images[10];
                item  = toolbar.Items.AddButton(image, "Quick Build", new EventHandler(this.QuickBuild));
                menuItems.Add(item);
            }

            // search items
            menu = this.mainForm.GetCBMenu("SearchMenu");
            if (menu != null)
            {
                menu.Items.AddSeparator();

                // goto back from declaration
                image = this.mainForm.GetSystemImage(18);
                k     = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_BACK);
                if (k != Keys.None)
                {
                    this.mainForm.IgnoredKeys.Add(k);
                }
                else
                {
                    ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut (" + MainForm.MainSettings.GetValue(SETTING_SHORTCUT_BACK) + ")");
                }
                item = menu.Items.AddButton(image, "&Back From Declaration", new EventHandler(this.BackDeclaration), k);
                menuItems.Add(item);

                // goto declaration
                image = this.mainForm.GetSystemImage(17);
                k     = MainForm.MainSettings.GetShortcut(SETTING_SHORTCUT_GOTO);
                if (k != Keys.None)
                {
                    this.mainForm.IgnoredKeys.Add(k);
                }
                else
                {
                    ErrorHandler.ShowInfo("Settings Error: Invalid Shortcut (" + MainForm.MainSettings.GetValue(SETTING_SHORTCUT_GOTO) + ")");
                }
                item = menu.Items.AddButton(image, "Goto &Declaration", new EventHandler(this.GotoDeclaration), k);
                menuItems.Add(item);
            }
            else
            {
                ErrorHandler.ShowInfo("MainMenu Error: no 'SearchMenu' group found");
            }

            /**
             *  Initialize completion context
             */
            sciReferences = new ArrayList();
            ASContext.Init(this);
            UITools.OnCharAdded     += new UITools.CharAddedHandler(OnChar);
            InfoTip.OnMouseHover    += new InfoTip.MouseHoverHandler(OnMouseHover);
            UITools.OnTextChanged   += new UITools.TextChangedHandler(ASContext.OnTextChanged);
            InfoTip.OnUpdateCallTip += new InfoTip.UpdateCallTipHandler(OnUpdateCallTip);
            this.mainForm.IgnoredKeys.Add(Keys.Control | Keys.Enter);
            this.mainForm.IgnoredKeys.Add(Keys.F1);

            /**
             *  Path to the Flash IDE
             */
            if (!MainForm.MainSettings.HasKey(SETTING_MACROMEDIA_FLASHIDE))
            {
                string found = "";
                foreach (string flashexe in MACROMEDIA_FLASHIDE_PATH)
                {
                    if (System.IO.File.Exists(flashexe))
                    {
                        found = flashexe;
                        break;
                    }
                }
                MainForm.MainSettings.AddValue(SETTING_MACROMEDIA_FLASHIDE, found);
            }
        }