Пример #1
0
 /// <summary>
 /// Removes a weak reference to an instance from the instances list.
 /// </summary>
 /// <param name="instance">An instance of <see cref="ImageListManager"/>.</param>
 private static void RemoveInstance(ImageListManager instance)
 {
     for (int i = 0, length = instances.Count; i < length; i++)
     {
         var imageListManager = instances[i].Target as ImageListManager;
         if (imageListManager == null)
         {
             instances.RemoveAt(i--);
             length--;
         }
         else if (imageListManager == instance)
         {
             instances.RemoveAt(i);
             break;
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Initialize the imagelist for the listView
 /// </summary>
 private void InitGraphics()
 {
     imageList = new ImageListManager();
     imageList.ColorDepth = ColorDepth.Depth32Bit;
     imageList.Initialize(ImageList_Populate);
     this.listView.SmallImageList = imageList;
 }
Пример #3
0
 /// <summary>
 /// Initializes the used graphics
 /// </summary>
 private void InitializeGraphics()
 {
     this.imageList = new ImageListManager();
     this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
     this.imageList.ColorDepth = ColorDepth.Depth32Bit;
     this.imageList.TransparentColor = Color.Transparent;
     this.imageList.Initialize(ImageList_Populate);
     this.layoutsListView.SmallImageList = this.imageList;
     this.menuLoadButton.Image = PluginBase.MainForm.FindImage("42|24|3|2");
     this.loadStripButton.Image = PluginBase.MainForm.FindImage("42|24|3|2");
     this.menuDeleteButton.Image = PluginBase.MainForm.FindImage("153");
     this.deleteStripButton.Image = PluginBase.MainForm.FindImage("153");
     this.menuSaveButton.Image = PluginBase.MainForm.FindImage("168");
     this.saveStripButton.Image = PluginBase.MainForm.FindImage("168");
     this.menuSettingButton.Image = PluginBase.MainForm.FindImage("54");
     this.settingStripButton.Image = PluginBase.MainForm.FindImage("54");
     this.toolStrip.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
 }
Пример #4
0
        /// <summary>
        /// This method is required for Windows Forms designer support.
        /// Do not change the method contents inside the source code editor. The Forms designer might
        /// not be able to load this method if it was changed manually.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PluginUI));
            this.treeIcons = new ImageListManager(this.components);
            this.toolStrip = new PluginCore.Controls.ToolStripEx();
            this.sortDropDown = new System.Windows.Forms.ToolStripDropDownButton();
            this.noneItem = new System.Windows.Forms.ToolStripMenuItem();
            this.sortedItem = new System.Windows.Forms.ToolStripMenuItem();
            this.sortedByKindItem = new System.Windows.Forms.ToolStripMenuItem();
            this.sortedSmartItem = new System.Windows.Forms.ToolStripMenuItem();
            this.sortedGroupItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.findProcTxt = new System.Windows.Forms.ToolStripSpringTextBox();
            this.clearButton = new System.Windows.Forms.ToolStripButton();
            this.toolStrip.SuspendLayout();
            this.SuspendLayout();
            // 
            // treeIcons
            // 
            this.treeIcons.TransparentColor = System.Drawing.Color.Transparent;            
            // 
            // toolStrip
            // 
            this.toolStrip.CanOverflow = false;
            this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
            this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.sortDropDown,
            this.toolStripSeparator1,
            this.findProcTxt,
            this.clearButton});
            this.toolStrip.Location = new System.Drawing.Point(1, 0);
            this.toolStrip.Name = "toolStrip";
            this.toolStrip.Size = new System.Drawing.Size(266, 25);
            this.toolStrip.TabIndex = 0;
            // 
            // sortDropDown
            // 
            this.sortDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.sortDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.noneItem,
            this.sortedItem,
            this.sortedByKindItem,
            this.sortedSmartItem,
            this.sortedGroupItem});
            this.sortDropDown.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.sortDropDown.Name = "sortDropDown";
            this.sortDropDown.Size = new System.Drawing.Size(13, 22);
            this.sortDropDown.Text = "";
            this.sortDropDown.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.SortDropDown_DropDownItemClicked);
            this.sortDropDown.DropDownOpening += new System.EventHandler(this.SortDropDown_DropDownOpening);
            this.sortDropDown.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1);
            // 
            // noneItem
            // 
            this.noneItem.Name = "noneItem";
            this.noneItem.Size = new System.Drawing.Size(152, 22);
            this.noneItem.Text = "None";
            // 
            // sortedItem
            // 
            this.sortedItem.Name = "sortedItem";
            this.sortedItem.Size = new System.Drawing.Size(152, 22);
            this.sortedItem.Text = "Sorted";
            // 
            // sortedByKindItem
            // 
            this.sortedByKindItem.Name = "sortedByKindItem";
            this.sortedByKindItem.Size = new System.Drawing.Size(152, 22);
            this.sortedByKindItem.Text = "SortedByKind";
            // 
            // sortedSmartItem
            // 
            this.sortedSmartItem.Name = "sortedSmartItem";
            this.sortedSmartItem.Size = new System.Drawing.Size(152, 22);
            this.sortedSmartItem.Text = "SortedSmart";
            // 
            // sortedGroupItem
            // 
            this.sortedGroupItem.Name = "sortedGroupItem";
            this.sortedGroupItem.Size = new System.Drawing.Size(152, 22);
            this.sortedGroupItem.Text = "SortedGroup";
            // 
            // toolStripSeparator1
            // 
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
            // 
            // findProcTxt
            // 
            this.findProcTxt.Name = "findProcTxt";
            this.findProcTxt.Size = new System.Drawing.Size(100, 25);
            this.findProcTxt.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0);
            this.findProcTxt.Leave += new System.EventHandler(this.FindProcTxtLeave);
            this.findProcTxt.Enter += new System.EventHandler(this.FindProcTxtEnter);
            this.findProcTxt.Click += new System.EventHandler(this.FindProcTxtEnter);
            this.findProcTxt.TextChanged += new System.EventHandler(this.FindProcTxtChanged);
            // 
            // clearButton
            //
            this.clearButton.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1);
            this.clearButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.clearButton.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.clearButton.Name = "clearButton";
            this.clearButton.Size = new System.Drawing.Size(23, 22);
            this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
            // 
            // PluginUI
            // 
            this.Controls.Add(this.toolStrip);
            this.Name = "PluginUI";
            this.Size = new System.Drawing.Size(268, 300);
            this.toolStrip.ResumeLayout(false);
            this.toolStrip.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
Пример #5
0
 /// <summary>
 /// Removes a weak reference to an instance from the instances list.
 /// </summary>
 /// <param name="instance">An instance of <see cref="ImageListManager"/>.</param>
 private static void RemoveInstance(ImageListManager instance)
 {
     for (int i = 0, length = instances.Count; i < length; i++)
     {
         var imageListManager = instances[i].Target as ImageListManager;
         if (imageListManager == null)
         {
             instances.RemoveAt(i--);
             length--;
         }
         else if (imageListManager == instance)
         {
             instances.RemoveAt(i);
             break;
         }
     }
 }
Пример #6
0
 /// <summary>
 /// Adds a weak reference of an instance to the <see cref="instances"/> list.
 /// </summary>
 /// <param name="instance">An instance of <see cref="ImageListManager"/>.</param>
 private static void AddInstance(ImageListManager instance)
 {
     instances.Add(new WeakReference(instance));
 }
Пример #7
0
 /// <summary>
 /// Adds a weak reference of an instance to the <see cref="instances"/> list.
 /// </summary>
 /// <param name="instance">An instance of <see cref="ImageListManager"/>.</param>
 private static void AddInstance(ImageListManager instance)
 {
     instances.Add(new WeakReference(instance));
 }
Пример #8
0
 /// <summary>
 /// Initializes the external graphics
 /// </summary>
 private void InitializeGraphics()
 {
     this.imageList = new ImageListManager();
     this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
     this.imageList.ColorDepth = ColorDepth.Depth32Bit;
     this.imageList.Populate += RefreshFileView;
     this.AddNonWin32Images();
     this.syncronizeButton.Image = PluginBase.MainForm.FindImage("203|9|-3|-3");
     this.browseButton.Image = PluginBase.MainForm.FindImage("203");
     this.fileView.SmallImageList = this.imageList;
 }
Пример #9
0
 /// <summary>
 /// Initializes the image list for entriesView
 /// </summary>
 public void InitializeGraphics()
 {
     imageList = new ImageListManager();
     imageList.ColorDepth = ColorDepth.Depth32Bit;
     imageList.TransparentColor = Color.Transparent;
     imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
     imageList.Initialize(ImageList_Populate);
     this.toolStripFilters.ImageList = imageList;
     this.entriesView.SmallImageList = imageList;
     this.clearFilterButton.Image = PluginBase.MainForm.FindImage("153");
     this.toolStripButtonInfo.Image = PluginBase.MainForm.FindImage("131");
     this.toolStripButtonError.Image = PluginBase.MainForm.FindImage("197");
     this.toolStripButtonWarning.Image = PluginBase.MainForm.FindImage("196");
 }
Пример #10
0
        /// <summary>
        /// Creates a menu item for the plugin and adds a ignored key
        /// </summary>
        public MenusHelper(Image pluginImage, DebuggerManager debugManager, Settings settings)
        {
            settingObject = settings;

            imageList = new ImageListManager();
            imageList.ColorDepth = ColorDepth.Depth32Bit;
            imageList.Populate += ImageList_Populate;
            imageList.Initialize();

            Image imgStartContinue = PluginBase.MainForm.GetAutoAdjustedImage(Resource.StartContinue);
            Image imgPause = PluginBase.MainForm.GetAutoAdjustedImage(Resource.Pause);
            Image imgStop = PluginBase.MainForm.GetAutoAdjustedImage(Resource.Stop);
            Image imgCurrent = PluginBase.MainForm.GetAutoAdjustedImage(Resource.Current);
            Image imgRunToCursor = PluginBase.MainForm.GetAutoAdjustedImage(Resource.RunToCursor);
            Image imgStep = PluginBase.MainForm.GetAutoAdjustedImage(Resource.Step);
            Image imgNext = PluginBase.MainForm.GetAutoAdjustedImage(Resource.Next);
            Image imgFinish = PluginBase.MainForm.GetAutoAdjustedImage(Resource.Finish);

            ToolStripMenuItem tempItem;
            ToolStripMenuItem viewMenu = (ToolStripMenuItem)PluginBase.MainForm.FindMenuItem("ViewMenu");
            tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewBreakpointsPanel"), pluginImage, OpenBreakPointPanel);
            PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowBreakpoints", tempItem);
            viewMenu.DropDownItems.Add(tempItem);
            tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewLocalVariablesPanel"), pluginImage, OpenLocalVariablesPanel);
            PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowLocalVariables", tempItem);
            viewMenu.DropDownItems.Add(tempItem);
            tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewStackframePanel"), pluginImage, OpenStackframePanel);
            PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowStackframe", tempItem);
            viewMenu.DropDownItems.Add(tempItem);
            tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewWatchPanel"), pluginImage, OpenWatchPanel);
            PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowWatch", tempItem);
            viewMenu.DropDownItems.Add(tempItem);
            tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewImmediatePanel"), pluginImage, OpenImmediatePanel);
            PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowImmediate", tempItem);
            viewMenu.DropDownItems.Add(tempItem);
            tempItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewThreadsPanel"), pluginImage, OpenThreadsPanel);
            PluginBase.MainForm.RegisterShortcutItem("ViewMenu.ShowThreads", tempItem);
            viewMenu.DropDownItems.Add(tempItem);

            // Menu           
            ToolStripMenuItem debugMenu = (ToolStripMenuItem)PluginBase.MainForm.FindMenuItem("DebugMenu");
            if (debugMenu == null)
            {
                debugMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Debug"));
                ToolStripMenuItem insertMenu = (ToolStripMenuItem)PluginBase.MainForm.FindMenuItem("InsertMenu");
                Int32 idx = PluginBase.MainForm.MenuStrip.Items.IndexOf(insertMenu);
                if (idx < 0) idx = PluginBase.MainForm.MenuStrip.Items.Count - 1;
                PluginBase.MainForm.MenuStrip.Items.Insert(idx, debugMenu);
            }

            StartContinueMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Start"), imgStartContinue, StartContinue_Click, Keys.None);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.Start", StartContinueMenu);
            PauseMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Pause"), imgPause, debugManager.Pause_Click, Keys.Control | Keys.Shift | Keys.F5);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.Pause", PauseMenu);
            StopMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Stop"), imgStop, debugManager.Stop_Click, Keys.Shift | Keys.F5);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.Stop", StopMenu);
            BreakOnAllMenu = new ToolStripMenuItem(TextHelper.GetString("Label.BreakOnAllErrors"), null, BreakOnAll_Click, Keys.Control | Keys.Alt | Keys.E);
            BreakOnAllMenu.Checked = PluginMain.settingObject.BreakOnThrow;
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.BreakOnAllErrors", BreakOnAllMenu);
            CurrentMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Current"), imgCurrent, debugManager.Current_Click, Keys.Shift | Keys.F10);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.Current", CurrentMenu);
            RunToCursorMenu = new ToolStripMenuItem(TextHelper.GetString("Label.RunToCursor"), imgRunToCursor, ScintillaHelper.RunToCursor_Click, Keys.Control | Keys.F10);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.RunToCursor", RunToCursorMenu);
            StepMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Step"), imgStep, debugManager.Step_Click, Keys.F11);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.StepInto", StepMenu);
            NextMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Next"), imgNext, debugManager.Next_Click, Keys.F10);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.StepOver", NextMenu);
            FinishMenu = new ToolStripMenuItem(TextHelper.GetString("Label.Finish"), imgFinish, debugManager.Finish_Click, Keys.Shift | Keys.F11);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.StepOut", FinishMenu);

            ToggleBreakPointMenu = new ToolStripMenuItem(TextHelper.GetString("Label.ToggleBreakpoint"), null, ScintillaHelper.ToggleBreakPoint_Click, Keys.F9);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.ToggleBreakpoint", ToggleBreakPointMenu);
            DeleteAllBreakPointsMenu = new ToolStripMenuItem(TextHelper.GetString("Label.DeleteAllBreakpoints"), null, ScintillaHelper.DeleteAllBreakPoints_Click, Keys.Control | Keys.Shift | Keys.F9);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.DeleteAllBreakpoints", DeleteAllBreakPointsMenu);
            ToggleBreakPointEnableMenu = new ToolStripMenuItem(TextHelper.GetString("Label.ToggleBreakpointEnabled"), null, ScintillaHelper.ToggleBreakPointEnable_Click, Keys.None);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.ToggleBreakpointEnabled", ToggleBreakPointEnableMenu);
            DisableAllBreakPointsMenu = new ToolStripMenuItem(TextHelper.GetString("Label.DisableAllBreakpoints"), null, ScintillaHelper.DisableAllBreakPoints_Click, Keys.None);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.DisableAllBreakpoints", DisableAllBreakPointsMenu);
            EnableAllBreakPointsMenu = new ToolStripMenuItem(TextHelper.GetString("Label.EnableAllBreakpoints"), null, ScintillaHelper.EnableAllBreakPoints_Click, Keys.None);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.EnableAllBreakpoints", EnableAllBreakPointsMenu);

            StartRemoteDebuggingMenu = new ToolStripMenuItem(TextHelper.GetString("Label.StartRemoteDebugging"), null, StartRemote_Click, Keys.None);
            PluginBase.MainForm.RegisterShortcutItem("DebugMenu.StartRemoteDebugging", StartRemoteDebuggingMenu);

            debugMenu.DropDownItems.AddRange(new ToolStripItem[]
            {
                StartContinueMenu, PauseMenu, StopMenu, BreakOnAllMenu, new ToolStripSeparator(),
                CurrentMenu, RunToCursorMenu, StepMenu, NextMenu, FinishMenu, new ToolStripSeparator(),
                ToggleBreakPointMenu, DeleteAllBreakPointsMenu, ToggleBreakPointEnableMenu ,DisableAllBreakPointsMenu, EnableAllBreakPointsMenu, new ToolStripSeparator(),
                StartRemoteDebuggingMenu
            });

            // ToolStrip
            m_ToolStripSeparator = new ToolStripSeparator();
            m_ToolStripSeparator.Margin = new Padding(1, 0, 0, 0);
            m_ToolStripSeparator2 = new ToolStripSeparator();
            StartContinueButton = new ToolStripButton(TextHelper.GetString("Label.Start"), imgStartContinue, StartContinue_Click);
            StartContinueButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            PluginBase.MainForm.RegisterSecondaryItem("DebugMenu.Start", StartContinueButton);
            PauseButton = new ToolStripButton(TextHelper.GetString("Label.Pause"), imgPause, debugManager.Pause_Click);
            PauseButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            PluginBase.MainForm.RegisterSecondaryItem("DebugMenu.Pause", PauseButton);
            StopButton = new ToolStripButton(TextHelper.GetString("Label.Stop"), imgStop, debugManager.Stop_Click);
            StopButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            PluginBase.MainForm.RegisterSecondaryItem("DebugMenu.Stop", StopButton);
            CurrentButton = new ToolStripButton(TextHelper.GetString("Label.Current"), imgCurrent, debugManager.Current_Click);
            CurrentButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            PluginBase.MainForm.RegisterSecondaryItem("DebugMenu.Current", CurrentButton);
            RunToCursorButton = new ToolStripButton(TextHelper.GetString("Label.RunToCursor"), imgRunToCursor, ScintillaHelper.RunToCursor_Click);
            RunToCursorButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            PluginBase.MainForm.RegisterSecondaryItem("DebugMenu.RunToCursor", RunToCursorButton);
            StepButton = new ToolStripButton(TextHelper.GetString("Label.Step"), imgStep, debugManager.Step_Click);
            StepButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            PluginBase.MainForm.RegisterSecondaryItem("DebugMenu.StepInto", StepButton);
            NextButton = new ToolStripButton(TextHelper.GetString("Label.Next"), imgNext, debugManager.Next_Click);
            NextButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            PluginBase.MainForm.RegisterSecondaryItem("DebugMenu.StepOver", NextButton);
            FinishButton = new ToolStripButton(TextHelper.GetString("Label.Finish"), imgFinish, debugManager.Finish_Click);
            FinishButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
            PluginBase.MainForm.RegisterSecondaryItem("DebugMenu.StepOut", FinishButton);
            m_ToolStripButtons = new ToolStripItem[] { m_ToolStripSeparator, StartContinueButton, PauseButton, StopButton, m_ToolStripSeparator2, CurrentButton, RunToCursorButton, StepButton, NextButton, FinishButton };

            // Events
            PluginMain.debugManager.StateChangedEvent += UpdateMenuState;
            PluginMain.settingObject.BreakOnThrowChanged += BreakOnThrowChanged;
        }
Пример #11
0
 /// <summary>
 /// Initializes the external graphics
 /// </summary>
 private void InitializeGraphics()
 {
     this.imageList = new ImageListManager();
     this.imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
     this.imageList.ColorDepth = ColorDepth.Depth32Bit;
     this.imageList.Initialize(ImageList_Populate);
     this.listView.SmallImageList = this.imageList;
     this.removeBookmarksItem.Image = PluginBase.MainForm.FindImage("402|4|4|4");
     this.searchButton.Image = PluginBase.MainForm.FindImage("484|26|-4|4");
 }