private ContextAvailability TryGetCdnInfo(ref CdnInfo cdnInfo, out ContextResult <CdnInfo> contextResult) { if (this.State != ContextState.Ready) { return(NotReady(out contextResult)); } if (cdnInfo.BuildId > 0) { contextResult = new ContextResult <CdnInfo>(cdnInfo); return(ContextAvailability.Available); } if (cdnInfo.BuildId < 0) { contextResult = new ContextResult <CdnInfo>(cdnInfo, "Failed to determine build ID from CDN."); return(ContextAvailability.Failed); } contextResult = new ContextResult <CdnInfo>(cdnInfo, "Build ID has not been requested from the CDN."); return(ContextAvailability.Unavailable); }
/// <summary> /// If <see cref="ContextAvailability.Available"/>, returns /// <see cref="ReadOnlyCollection{Festival}"/> containing a /// collection of all currently active festivals. /// </summary> public ContextAvailability TryGetActiveFestivals(out ContextResult <ReadOnlyCollection <Festival> > contextResult) { if (!string.IsNullOrEmpty(_fault)) { contextResult = new ContextResult <ReadOnlyCollection <Festival> >(default, _fault);
/// <summary> /// If <see cref="ContextAvailability.Available"/>, returns /// <see cref="CdnInfo"/> provided by the Chinese asset CDN. /// </summary> public ContextAvailability TryGetChineseCdnInfo(out ContextResult <CdnInfo> contextResult) { return(TryGetCdnInfo(ref _chineseCdnInfo, out contextResult)); }
/// <summary> /// If <see cref="ContextAvailability.Available"/>, returns /// <see cref="CdnInfo"/> provided by the standard asset CDN. /// </summary> public ContextAvailability TryGetStandardCdnInfo(out ContextResult <CdnInfo> contextResult) { return(TryGetCdnInfo(ref _standardCdnInfo, out contextResult)); }