private void ToolButtonClick(ToolEntry toolEntry)
        {
            if (string.IsNullOrEmpty(toolEntry.cmd))
            {
                //TODO TabIndex => To Enum
                OpenSettings(2);
                return;
            }

            if (CurrentLogWindow != null)
            {
                ILogLine     line = CurrentLogWindow.GetCurrentLine();
                ILogFileInfo info = CurrentLogWindow.GetCurrentFileInfo();
                if (line != null && info != null)
                {
                    ArgParser parser  = new ArgParser(toolEntry.args);
                    string    argLine = parser.BuildArgs(line, CurrentLogWindow.GetRealLineNum() + 1, info, this);
                    if (argLine != null)
                    {
                        StartTool(toolEntry.cmd, argLine, toolEntry.sysout, toolEntry.columnizerName,
                                  toolEntry.workingDir);
                    }
                }
            }
        }
        private void SetToolIcon(ToolEntry entry, ToolStripItem item)
        {
            Icon icon = Win32.LoadIconFromExe(entry.iconFile, entry.iconIndex);

            if (icon != null)
            {
                item.Image = icon.ToBitmap();
                if (item is ToolStripMenuItem)
                {
                    item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
                }
                else
                {
                    item.DisplayStyle = ToolStripItemDisplayStyle.Image;
                }

                DestroyIcon(icon.Handle);
                icon.Dispose();
            }

            if (!string.IsNullOrEmpty(entry.cmd))
            {
                item.ToolTipText = entry.name;
            }
        }
Exemple #3
0
        public ToolEntry Clone()
        {
            ToolEntry clone = new ToolEntry();

            clone.cmd            = this.cmd;
            clone.args           = this.args;
            clone.name           = this.name;
            clone.sysout         = this.sysout;
            clone.columnizerName = this.columnizerName;
            clone.isFavourite    = this.isFavourite;
            clone.iconFile       = this.iconFile;
            clone.iconIndex      = this.iconIndex;
            clone.workingDir     = this.workingDir;
            return(clone);
        }
Exemple #4
0
		public ToolEntry Clone()
		{
			ToolEntry clone = new ToolEntry();
			clone.cmd = this.cmd;
			clone.args = this.args;
			clone.name = this.name;
			clone.sysout = this.sysout;
			clone.columnizerName = this.columnizerName;
			clone.isFavourite = this.isFavourite;
			clone.iconFile = this.iconFile;
			clone.iconIndex = this.iconIndex;
			clone.workingDir = this.workingDir;
			return clone;
		}