TestStand OperatorInterface 启动源码

    private static void LaunchHelper(
      LaunchTestStandApplicationInNewDomain.MainEntryPointDelegate entryPoint,
      LaunchTestStandApplicationInNewDomain.MainEntryPointDelegateWithArgs entryPointWithArgs,
      string[] args,
      bool parseArgs)
    {
      if (parseArgs)
        LaunchTestStandApplicationInNewDomain.SetEngineEnvironment(TSHelper.ParseEnvironmentPathFromArgs(ref args, false, (string) null));
      Engine engine = (Engine) new EngineClass();
      try
      {
        AppDomain domain = AppDomain.CreateDomain("TestStandAppDomain");
        LaunchTestStandApplicationInNewDomain.TestStandApplication instanceFromAndUnwrap = domain.CreateInstanceFromAndUnwrap(Assembly.GetExecutingAssembly().Location, typeof (LaunchTestStandApplicationInNewDomain.TestStandApplication).FullName) as LaunchTestStandApplicationInNewDomain.TestStandApplication;
        if (entryPoint != null)
          instanceFromAndUnwrap.CallEntryPoint(entryPoint);
        else
          instanceFromAndUnwrap.CallEntryPoint(entryPointWithArgs, args);
        AppDomain.Unload(domain);
      }
      finally
      {
        LaunchTestStandApplicationInNewDomain.CleanUpAfterNewAppDomainFinished(engine);
      }
    }

  

原文地址:https://www.cnblogs.com/YourDirection/p/13765730.html