Exemple #1
0
        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);
        }
Exemple #2
0
 /// <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);
Exemple #3
0
 /// <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));
 }
Exemple #4
0
 /// <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));
 }