internal void Add(ExtensionData extensionData, OmexConstants.AppState state) { byte[] manifestBytes = extensionData.GetManifestBytes(); if (manifestBytes == null || manifestBytes.Length == 0) { throw new ArgumentNullException("extensionData Manifest"); } if (extensionData.Version == null) { throw new ArgumentNullException("extensionData Version"); } if (extensionData.RequestedCapabilities == null) { throw new ArgumentNullException("extensionData RequestedCapabilities"); } ExtensionsCache.Tracer.TraceDebug <string>(0L, "ExtensionsCache.Add: Adding Extension {0} from ExtensionData", extensionData.MarketplaceAssetID); ExtensionsCacheEntry entry = new ExtensionsCacheEntry(extensionData.MarketplaceAssetID, extensionData.ExtensionId, extensionData.Version, new RequestedCapabilities?(extensionData.RequestedCapabilities.Value), state, manifestBytes); this.AddExtension(entry); }
public ExtensionsCacheEntry(string marketplaceAssetID, string extensionID, Version version, RequestedCapabilities?requestedCapabilities, OmexConstants.AppState state, byte[] manifest) { if (string.IsNullOrEmpty(marketplaceAssetID)) { throw new ArgumentNullException("marketPlaceAssetID"); } if (string.IsNullOrEmpty(extensionID)) { throw new ArgumentNullException("extensionID"); } this.MarketplaceAssetID = marketplaceAssetID; this.ExtensionID = extensionID; this.Version = version; this.RequestedCapabilities = requestedCapabilities; this.State = state; this.Manifest = manifest; this.SetLastUpdateCheckTime(); this.SetSize(); }
// Token: 0x06000BEA RID: 3050 RVA: 0x00030CA0 File Offset: 0x0002EEA0 internal void GetAppStateSuccessCallback(List <AppStateResponseAsset> appStateResponses, Uri appStateUri) { GetUpdates.Tracer.TraceDebug <int>(0L, "GetUpdates.GetAppStateSuccessCallback called with {0} responses", appStateResponses.Count); this.extensionUpdates = new List <ExtensionData>(); foreach (AppStateResponseAsset appStateResponseAsset in appStateResponses) { string value = string.Empty; OmexConstants.AppState valueOrDefault = appStateResponseAsset.State.GetValueOrDefault(); OmexConstants.AppState?appState; if (appState == null) { goto IL_8B; } switch (valueOrDefault) { case OmexConstants.AppState.Killed: case OmexConstants.AppState.OK: break; case OmexConstants.AppState.Withdrawn: value = "3.1"; break; case OmexConstants.AppState.Flagged: value = "3.2"; break; case OmexConstants.AppState.WithdrawingSoon: value = "3.3"; break; default: goto IL_8B; } IL_91: if (!(appStateResponseAsset.State != OmexConstants.AppState.Killed)) { continue; } string text = string.Empty; if (string.IsNullOrWhiteSpace(appStateResponseAsset.ExtensionID)) { UpdateRequestAsset updateRequestAsset; if (this.updateRequestAssets.TryGetValue(appStateResponseAsset.MarketplaceAssetID, out updateRequestAsset)) { text = updateRequestAsset.ExtensionID; } } else { text = appStateResponseAsset.ExtensionID; } if (!string.IsNullOrWhiteSpace(text)) { this.appStatuses.Add(text, value); continue; } continue; IL_8B: value = "3.0"; goto IL_91; } this.downloadQueue = this.BuildDownloadQueue(appStateResponses, appStateUri, this.extensionUpdates); if (this.downloadQueue.Count > 0) { this.downloadApp = new DownloadApp(OmexWebServiceUrlsCache.Singleton); this.ExecuteDownload(this.downloadApp); return; } if (this.extensionUpdates.Count > 0) { this.InstallExtensionUpdates(this.extensionUpdates, this.queryContext); return; } this.ExecuteNextUpdateQuery(); }