Ejemplo n.º 1
0
        public static TestStep CreateTestStep(string stepDisplayName)
        {
            var      stepInfo = TestStepInfoMgr.Instance.TestStepInfoList.Where(x => x.DisplayName == stepDisplayName).FirstOrDefault();
            TestStep step     = null;

            if (stepDisplayName == TestStepType.Loop)
            {
                step = new LoopTestStep();
            }
            else if (stepDisplayName == TestStepType.Manual)
            {
                step = new ManualLoopTestStep();
            }
            else if (stepDisplayName == TestStepType.Cal)
            {
                step = new FormulaCalcTestStep();
            }
            else
            {
                Type stepType = stepInfo.Assembly.GetType(stepInfo.StepType.ToString());
                step = Activator.CreateInstance(stepType) as TestStep;
            }

            return(step);
        }
Ejemplo n.º 2
0
 private void MenuItem_Click(object sender, RoutedEventArgs e)
 {
     if ((sender as MenuItem).Header.ToString() == "删除行")
     {
         var items = manualgridControl.SelectedItems;
         if (items.Count != 0)
         {
             List <int> selectList = new List <int>(manualgridView.GetSelectedRowHandles());
             for (int row = selectList.Count - 1; row >= 0; row--)
             {
                 manualgridView.DeleteRow(selectList[row]);
             }
         }
     }
     else if ((sender as MenuItem).Header.ToString() == "快速填充")
     {
         if (manualgridControl.CurrentColumn != null)
         {
             ManualLoopTestStep loopStep = vm.ManualLoopTestStep;
             int        columnIndex      = manualgridControl.Columns.IndexOf(manualgridView.FocusedColumn);
             DataColumn column           = loopStep.ColumnTable.Columns[columnIndex];
             FillDataToTable(vm.ManualLoopTestStep.ColumnTable, column.ColumnName, columnIndex, column.DataType);
         }
     }
 }