public ExternalToolConfigForm(ExternalToolConfig extenalToolConfig)
        {
            InitializeComponent();
            if (extenalToolConfig != null)
            {
                ExternalToolConfig = extenalToolConfig;
            }
            else
            {
                ExternalToolConfig      = new ExternalToolConfig();
                ExternalToolConfig.Name = "New Tool";
            }

            List <string> parameterNames = new List <string>();

            foreach (ExternalTool.ParameterName parameterName in Enum.GetValues(typeof(ExternalTool.ParameterName)))
            {
                parameterNames.Add(ExternalTool.GetParameterSymbol(parameterName));
            }

            _paramBindingSource.DataSource = parameterNames;

            _argParamCmb.DataSource     = _paramBindingSource;
            _initDirParamCmb.DataSource = _paramBindingSource;
        }
Example #2
0
 private void UpdateExtToolListItem(ExternalToolConfig extTool, ref ListViewItem lvi)
 {
     lvi.SubItems.Clear();
     lvi.Text = extTool.Name;
     lvi.UseItemStyleForSubItems = false;
     lvi.SubItems.Add(extTool.ShortcutKey);
     lvi.Tag = extTool;
 }
        public ExternalToolConfigForm(ExternalToolConfig extenalToolConfig)
        {
            InitializeComponent();
            if (extenalToolConfig != null)
                ExternalToolConfig = extenalToolConfig;
            else
            {
                ExternalToolConfig = new ExternalToolConfig();
                ExternalToolConfig.Name = "New Tool";
            }

            List<string> parameterNames = new List<string>();
            foreach (ExternalTool.ParameterName parameterName in Enum.GetValues(typeof(ExternalTool.ParameterName)))
                parameterNames.Add(ExternalTool.GetParameterSymbol(parameterName));

            _paramBindingSource.DataSource = parameterNames;

            _argParamCmb.DataSource = _paramBindingSource;
            _initDirParamCmb.DataSource = _paramBindingSource;
        }
Example #4
0
        private ExternalTool GenerateExternalTool(ExternalToolConfig toolConfig, string line, int? lineNumber, string keywordMatch)
        {
            Dictionary<ExternalTool.ParameterName, string> fileParameters = new Dictionary<ExternalTool.ParameterName, string>();
            fileParameters[ExternalTool.ParameterName.FilePath] = _logTailStream != null ? _logTailStream.Name : string.Empty;
            fileParameters[ExternalTool.ParameterName.FileDirectory] = Path.GetDirectoryName(fileParameters[ExternalTool.ParameterName.FilePath]);
            fileParameters[ExternalTool.ParameterName.FileName] = Path.GetFileName(fileParameters[ExternalTool.ParameterName.FilePath]);
            fileParameters[ExternalTool.ParameterName.ServiceName] = _taskMonitor != null ? _taskMonitor.ServiceName : string.Empty;
            fileParameters[ExternalTool.ParameterName.SessionDirectory] = _configPath;
            fileParameters[ExternalTool.ParameterName.SessionPath] = MainForm.Instance.CurrenTailConfig;
            fileParameters[ExternalTool.ParameterName.SessionFileName] = Path.GetFileName(fileParameters[ExternalTool.ParameterName.SessionPath]);
            fileParameters[ExternalTool.ParameterName.SessionName] = Path.GetFileNameWithoutExtension(fileParameters[ExternalTool.ParameterName.SessionPath]);
            fileParameters[ExternalTool.ParameterName.ViewName] = _formTitle;
            fileParameters[ExternalTool.ParameterName.ProgramDirectory] = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            fileParameters[ExternalTool.ParameterName.LineText] = line != null ? line : string.Empty;
            fileParameters[ExternalTool.ParameterName.LineNumber] = lineNumber.HasValue ? lineNumber.Value.ToString() : string.Empty;
            fileParameters[ExternalTool.ParameterName.KeywordText] = keywordMatch != null ? keywordMatch : string.Empty;

            ExternalTool tool = new ExternalTool(toolConfig, fileParameters);
            return tool;
        }
Example #5
0
 public ExternalTool(ExternalToolConfig toolConfig, Dictionary <ParameterName, string> fileParameters)
 {
     ToolConfig      = toolConfig;
     _fileParameters = fileParameters;
 }
Example #6
0
 private void UpdateExtToolListItem(ExternalToolConfig extTool, ref ListViewItem lvi)
 {
     lvi.SubItems.Clear();
     lvi.Text = extTool.Name;
     lvi.UseItemStyleForSubItems = false;
     lvi.SubItems.Add(extTool.ShortcutKey);
     lvi.Tag = extTool;
 }
Example #7
0
 public ExternalTool(ExternalToolConfig toolConfig, Dictionary<ParameterName, string> fileParameters)
 {
     ToolConfig = toolConfig;
     _fileParameters = fileParameters;
 }