Example #1
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;
 }
Example #2
0
        public ActionResult RejectInvoice(AddInvoiceViewModel viewModel)
        {
            string errorMessage = "";

            prepcode = this.PrepCode;

            // Format reason string.
            string reason = DateTime.Now.ToString() + " " + prepcode;

            reason += " - " + viewModel.REJECTOPTION + " / " + viewModel.REJECTDESCRIPTION;

            // Mark invoice as rejected.
            if (!RejectPegasysInvoice(viewModel))
            {
                errorMessage = "Reject invoice failed. ";
            }

            // Write transhist entry.
            string    memo  = "Image Rejected from data entry - " + reason;
            var       mgrTH = new TransHistManager();
            TRANSHIST th    = CreateTransHistForChange(viewModel, memo, DataEntry.ImgReject);

            mgrTH.InsertTransHist(th);

            // Update imagelist.
            var       mgrIL = new ImageListManager();
            IMAGELIST il    = mgrIL.GetImageListByImageId(viewModel.IMAGEID);

            if (il != null)
            {
                // Mark as rejected and update.
                mgrIL.RejectImageList(viewModel.IMAGEID, prepcode, reason);
            }
            else
            {
                var           mgrILH = new ImageListHistManager();
                IMAGELISTHIST ilh    = mgrILH.GetImageListHistByImageId(viewModel.IMAGEID);
                if (ilh != null)
                {
                    // Convert to ImageList and mark as rejected.
                    il = mgrIL.MapToImageList(ilh);
                    MarkImageListAsRejected(il, reason);
                    // Add to ImageList.
                    mgrIL.InsertImageList(il);
                    // Remove from ImageListHist.
                    mgrILH.DeleteImageListHist(ilh);
                }
                else
                {
                    // Uh oh. No imagelisthist entry.
                    errorMessage += viewModel.IMAGEID + " does not exist in the ImageListHist table.";
                }
            }

            // Reload the index page to move to the next invoice, if available.
            TempData["ErrorMessage"] = errorMessage;
            return(RedirectToAction("Index", new { InvoiceType = viewModel.INVOICETYPE }));
        }
Example #3
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");
 }
        public DropboxFilesForm(OAuthInfo oauth, string path = null)
        {
            InitializeComponent();
            dropbox = new Dropbox(oauth);
            ilm     = new ImageListManager(lvDropboxFiles);

            if (path != null)
            {
                Shown += (sender, e) => OpenDirectory(path);
            }
        }
Example #5
0
        public DropboxFilesForm(OAuth2Info oauth, string path, DropboxAccountInfo accountInfo)
        {
            InitializeComponent();
            Icon = ShareXResources.Icon;

            dropbox = new Dropbox(oauth);
            dropboxAccountInfo = accountInfo;
            ilm = new ImageListManager(lvDropboxFiles);

            if (path != null)
            {
                Shown += (sender, e) => OpenDirectory(path);
            }
        }
Example #6
0
        public DropboxFilesForm(OAuthInfo oauth, string path, DropboxAccountInfo accountInfo)
        {
            InitializeComponent();
            Icon = Resources.Dropbox;

            dropbox            = new Dropbox(oauth);
            dropboxAccountInfo = accountInfo;
            ilm = new ImageListManager(lvDropboxFiles);

            if (path != null)
            {
                Shown += (sender, e) => OpenDirectory(path);
            }
        }
Example #7
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");
 }
Example #8
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));
 }
Example #9
0
 void ProjectExplorerControl_Disposed(object sender, EventArgs e)
 {
     if (_listener != null)
     {
         _listener.Dispose();
         _listener = null;
     }
     if (_imageList != null)
     {
         _imageList.Dispose();
         _imageList = null;
     }
     if (_resourceManager != null)
     {
         _resourceManager.Dispose();
         _resourceManager = null;
     }
 }
Example #10
0
        public ProjectExplorerControl()
        {
            InitializeComponent();

            _treeView.ApplyExplorerTheme();

            _resourceManager = new ResourceManager();

            _imageList          = new ImageListManager();
            _treeView.ImageList = _imageList.ImageList;

            _defaultFile = LoadResource(_imageList.GetIndexForFileName(
                                            Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString())
                                            ));
            _defaultContainer = LoadResource(_imageList.GetIndexForDirectory(Path.GetTempPath()));

            Disposed += ProjectExplorerControl_Disposed;
        }
Example #11
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;
        }