Example Title |
Copy Code
|
---|---|
/* * How to call: ComponentFactory componenetF = (ComponentFactory) tdConnection.ComponentFactory; TDFilter tdFilter = componenetF.Filter; tdFilter["CO_NAME"] = "TestComponent"; List tdList = tdFilter.NewList(); Component componentNew = tdList[1]; AddParamsAndSteps(componentNew); */ private void AddParamsAndSteps(Component myComponent) { ComponentParamFactory compParamFactory; ComponentParam compParam1, compParam2, compParam3; ComponentStepFactory compStepFactory; ComponentStep compStep1, compStep2; compParamFactory = (ComponentParamFactory)myComponent.ComponentParamFactory; compStepFactory = (ComponentStepFactory)myComponent.ComponentStepFactory; compParam1 = compParamFactory.AddItem(DBNull.Value); compParam1.IsOut = 1; compParam1.Name = "OutParam"; compParam1.Desc = "Description for output parameter"; compParam1.ValueType = "String"; compParam1.Order = 1; compParam1.Post(); compParam2 = compParamFactory.AddItem(DBNull.Value); compParam2.IsOut = 0; compParam2.Name = "InParam"; compParam2.Desc = "Description for input parameter"; compParam2.ValueType = "String"; compParam2.Order = 1; compParam2.Post(); compParam3 = compParamFactory.AddItem(DBNull.Value); compParam3.IsOut = 0; compParam3.Name = "InParam2"; compParam3.Desc = "Description for input parameter number two"; compParam3.ValueType = "String"; compParam3.Order = 2; compParam3.Post(); compStep1 = compStepFactory.AddItem(DBNull.Value); compStep1.StepName = "First Step"; compStep1.StepDescription = "<html><body>Description can contain <<<InParam>>> that are verified by QC</body></html>"; compStep1.StepExpectedResult = "<html><body>Can also contain <<<OutParam>>> and <<<badParamName>>></body></html>"; compStep1.Order = 1; compStep1.Validate();//will result in exception because of the badParamName. compStep1.Post(); myComponent.Post(); } |