/// <summary> /// Initializes a new instance of the <see cref="MachineReservationHandler"/> class. /// </summary> /// <param name="manifest">The manifest.</param> public CitrixPublishedApplicationHandler(SystemManifest manifest) : base(manifest) { _worker = SystemManifest.Resources.OfType <CitrixWorkerDetail>().First(); _citrixServer = _worker.ServerHostname; _credential = SystemManifest.Resources.Credentials.First(); VirtualResourceEventBus.OnStartMainRun += VirtualResourceEventBus_OnStartMainRun; VirtualResourceEventBus.OnShutdownResource += VirtualResourceEventBus_OnShutdownResource; VirtualResourceEventBus.OnPauseResource += VirtualResourceEventBus_OnPauseResource; VirtualResourceEventBus.OnResumeResource += VirtualResourceEventBus_OnResumeResource; }
protected override void LoadChildDetail(ResourceDetailBase detail) { base.LoadChildDetail(detail); CitrixWorkerDetail resourceDetail = detail as CitrixWorkerDetail; if (resourceDetail != null) { PublishedApp = resourceDetail.PublishedApp; RunMode = resourceDetail.WorkerRunMode; ServerHostname = resourceDetail.ServerHostname; } }
public override OfficeWorkerDetail CreateDetail(VirtualResource resource) { CitrixWorker worker = resource as CitrixWorker; CitrixWorkerDetail detail = new CitrixWorkerDetail(); CreateBaseWorkerDetail(worker, detail); detail.PublishedApp = worker.PublishedApp; detail.WorkerRunMode = worker.RunMode; detail.ServerHostname = worker.ServerHostname; CreateMetadataDetail(resource, detail); return(detail); }
/// <summary> /// Initializes a new instance of the <see cref="CitrixWorkerHandler" /> class. /// </summary> /// <param name="manifest">The manifest.</param> public CitrixWorkerHandler(SystemManifest manifest) : base(manifest) { if (manifest == null) { throw new ArgumentNullException("manifest"); } _userProfile = Environment.GetEnvironmentVariable("USERPROFILE"); _credential = SystemManifest.Resources.Credentials.First(); _credential.WorkingDirectory = Directory.GetCurrentDirectory(); _worker = SystemManifest.Resources.OfType <CitrixWorkerDetail>().First(); _citrixServer = _worker.ServerHostname; _randomizeStartupDelay = _worker.RandomizeStartupDelay; _minStartupDelay = TimeSpan.FromSeconds(_worker.MinStartupDelay); _maxStartupDelay = TimeSpan.FromSeconds(_worker.MaxStartupDelay); }