示例#1
0
 public void Start<TModuleProvider>(string connectionString, string applicationName) where TModuleProvider:ModuleBase{
     try {
         _domain = AppDomain.CreateDomain("Server");
         _starter = (WorkflowServerStarter)_domain.CreateInstanceAndUnwrap(
             Assembly.GetEntryAssembly().FullName, GetType().FullName ?? throw new InvalidOperationException());
         _starter.OnServerDomainCustomHandleException += StarterOnOnServerDomainCustomHandleException;
         var workflowServerEventArgs = new WorkflowServerEventArgs();
         OnWorkflowServerRequested(workflowServerEventArgs);
         _starter.StartOnServerDomain<TModuleProvider>(connectionString, applicationName);
     }
     catch (Exception e) {
         Tracing.Tracer.LogError(e);
         OnCustomHandleException?.Invoke(null, new ExceptionEventArgs("Exception occurs:\r\n\r\n" + e.Message));
     }
 }
示例#2
0
 void StarterOnOnServerDomainCustomHandleException(object sender, ExceptionEventArgs e){
     OnCustomHandleException?.Invoke(null, e);
 }