internal P_LoadedPackageState(DefaultDescriptionPackageService service, DescriptionPackageLocator locator) { service.EnsureNotNull(nameof(service)); locator.EnsureNotNull(nameof(locator)); // _service = service; _locator = locator; _disposeCts = new CancellationTokenSource(); _loader = new AsyncOperator <IDescriptionPackage>(asyncFactory: P_LoadNewPackageInstanceAsync, ownsResult: true); }
internal P_LoadedPackageState(DefaultDescriptionPackageService service, IDescriptionPackage package, DescriptionPackageLocator locator, bool ownsPackage = false) { service.EnsureNotNull(nameof(service)); package.EnsureNotNull(nameof(package)); locator.EnsureNotNull(nameof(locator)); // _service = service; _locator = locator; _disposeCts = null; _loader = new AsyncOperator <IDescriptionPackage>(result: package, ownsResult: ownsPackage); }
protected override void Dispose(bool explicitDispose) { if (explicitDispose) { _loader?.Dispose(); _disposeCts?.Dispose(); } _service = null; _locator = null; _disposeCts = null; _loader = null; // base.Dispose(explicitDispose); }