Esempio n. 1
0
        private void GetConfigFromRow(DataGridViewRow _row)
        {
            try
            {
                string strProcessName = "";
                string strCommand     = "";
                string strEventtyp    = "";
                string strExeEventtyp = "";
                bool   bEnable        = false;
                ExternTool.ProcessEventTyp        _PrcEventType    = ExternTool.ProcessEventTyp.ProcessStart;
                ExternTool.ProcessEventExecuteTyp _PrcExeEventType = ExternTool.ProcessEventExecuteTyp.Command;

                strProcessName = _row.Cells["colProcessName"].Value as string;
                strCommand     = _row.Cells["colStartCommand"].Value as string;
                strEventtyp    = _row.Cells["colWindowEventTyp"].Value as string;
                strExeEventtyp = _row.Cells["colExecuteEventtyp"].Value as string;
                bEnable        = Convert.ToBoolean(_row.Cells["colEnable"].Value);

                if (!string.IsNullOrEmpty(strCommand) && !string.IsNullOrEmpty(strCommand) && !string.IsNullOrEmpty(strEventtyp) && !string.IsNullOrEmpty(strExeEventtyp))
                {
                    _PrcEventType    = ExternalToolConfig.GetEnumEventTypValue(strEventtyp);
                    _PrcExeEventType = ExternalToolConfig.GetEnumEventExecuteTypValue(strExeEventtyp);

                    ExternalToolConfig exCon = new ExternalToolConfig(strProcessName, _PrcEventType, strCommand, bEnable, _PrcExeEventType);
                    if (exCon != null)
                    {
                        mylExConfigs.Add(exCon);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.cLogger.Log(ex);
            }
        }
Esempio n. 2
0
        public static string GetStringEventTypValue(ExternTool.ProcessEventTyp _ProcessEventTyp)
        {
            switch (_ProcessEventTyp)
            {
            case ExternTool.ProcessEventTyp.ProcessStart:
                return("Start");

            case ExternTool.ProcessEventTyp.ProcessEnd:
                return("End");

            case ExternTool.ProcessEventTyp.BasicData:
                return("Basicdata");

            case ExternTool.ProcessEventTyp.WindowTitle:
                return("Title");

            case ExternTool.ProcessEventTyp.WindowStyle:
                return("Style");

            case ExternTool.ProcessEventTyp.PositionSize:
                return("PositionSize");

            case ExternTool.ProcessEventTyp.WindowExStyle:
                return("ExStyle");

            case ExternTool.ProcessEventTyp.DataText:
                return("Datatext");

            default:
                return("End");
            }
        }