Gets a specific program from the rununit with a option to create it.
Namespace: MicroFocus.COBOL.RuntimeServices.Generic
Assembly: MicroFocus.COBOL.RuntimeServices (in MicroFocus.COBOL.RuntimeServices.dll) Version: 1.2.3.4
Syntax
public AnotherProgramOrClass Get<AnotherProgramOrClass>( Type programType, bool create = false ) where AnotherProgramOrClass : IObjectControl
Parameters
- programType
- Type: SystemType
- create (Optional)
- Type: SystemBoolean
(default=false)
Type Parameters
- AnotherProgramOrClass
Return Value
Type: AnotherProgramOrClassImplements
IRunUnitProgramOrClassGetAnotherProgramOrClass(Type, Boolean)Examples
using(var myRunUnit = new RunUnit<myapp>()) /* Create a RunUnit and include myapp in it */ { using(myRunUnit.Enter()) { /* Enter myRunUnit */ myapp app = myRunUnit.Get(); /* use the methods */ app.SomeMethod(); app.AnotherMethod(); otherprogram op = myRunUnit.Get<otherprogram>(typeof(otherprogram), true); op.otherprogram(); } // Leave myRunUnit } // StopRun myRunUnit
See Also