public NestResult Start(IEggParameters parameters) { host = parameters.Host; var configuration = pofSerializer.Deserialize <TrinketStartupConfiguration>(streamFactory.CreateMemoryStream(parameters.Arguments).Reader); trinketDtpServer = trinketDtpServerFactory.Create(configuration); var trinketBridge = new TrinketBridgeImpl(temporaryFileService, processInjectionService, trinketInternalUtilities, configuration, trinketDtpServer); keepaliveObjects.Add(trinketBridge); var injectionSuccessful = trinketBridge.Initialize(); if (injectionSuccessful) { var process = processProxy.GetProcessById(configuration.TargetProcessId); process.Exited += (o, s) => { Shutdown(ShutdownReason.None); }; process.EnableRaisingEvents = true; } return(injectionSuccessful ? NestResult.Success : NestResult.Failure); }
public NestResult Start(IEggParameters parameters) { host = parameters.Host; var configuration = pofSerializer.Deserialize<TrinketStartupConfiguration>(streamFactory.CreateMemoryStream(parameters.Arguments).Reader); trinketDtpServer = trinketDtpServerFactory.Create(configuration); var trinketBridge = new TrinketBridgeImpl(temporaryFileService, processInjectionService, trinketInternalUtilities, configuration, trinketDtpServer); keepaliveObjects.Add(trinketBridge); var injectionSuccessful = trinketBridge.Initialize(); if (injectionSuccessful) { var process = processProxy.GetProcessById(configuration.TargetProcessId); process.Exited += (o, s) => { Shutdown(ShutdownReason.None); }; process.EnableRaisingEvents = true; } return injectionSuccessful ? NestResult.Success : NestResult.Failure; }