コード例 #1
0
 public bool TryCheckAgainstRestrictions(DownloadableContentRestrictionCategory category, string contentId, out bool result, out bool found, out string replacement)
 {
     result      = true;
     replacement = string.Empty;
     found       = false;
     if (category == DownloadableContentRestrictionCategory.Undefined)
     {
         return(false);
     }
     if (string.IsNullOrEmpty(contentId))
     {
         return(false);
     }
     if (this.Restrictions.Count == 0)
     {
         return(true);
     }
     for (int i = 0; i < this.Restrictions.Count; i++)
     {
         if (this.Restrictions[i].Category == category && Amplitude.String.WildcardCompare(contentId, this.Restrictions[i].Wildcard, this.Restrictions[i].IgnoreCase))
         {
             found = true;
             if ((this.Accessibility & this.Restrictions[i].Accessibility) == DownloadableContentAccessibility.None)
             {
                 replacement = this.Restrictions[i].Replacement;
                 result      = false;
                 return(true);
             }
         }
     }
     return(true);
 }
コード例 #2
0
    public bool TryCheckAgainstRestrictions(DownloadableContentRestrictionCategory category, string contentId, out bool result, out string replacement)
    {
        result      = true;
        replacement = string.Empty;
        if (category == DownloadableContentRestrictionCategory.Undefined)
        {
            return(false);
        }
        if (string.IsNullOrEmpty(contentId))
        {
            return(false);
        }
        bool   result2 = false;
        string empty   = string.Empty;
        string text    = string.Empty;
        bool   flag    = false;
        bool   flag2   = false;

        foreach (DownloadableContent downloadableContent in this.DownloadableContents.Values)
        {
            bool flag3;
            downloadableContent.TryCheckAgainstRestrictions(category, contentId, out flag3, out flag2, out empty);
            if (flag2)
            {
                result2 = true;
                flag    = flag3;
                if (flag3)
                {
                    break;
                }
                text = empty;
            }
        }
        replacement = text;
        result      = flag;
        return(result2);
    }
コード例 #3
0
    public bool TryCheckAgainstRestrictions(DownloadableContentRestrictionCategory category, string contentId, out bool result)
    {
        result = true;
        if (category == DownloadableContentRestrictionCategory.Undefined)
        {
            return(false);
        }
        if (string.IsNullOrEmpty(contentId))
        {
            return(false);
        }
        bool flag = true;

        foreach (DownloadableContent downloadableContent in this.DownloadableContents.Values)
        {
            string text;
            flag &= downloadableContent.TryCheckAgainstRestrictions(category, contentId, out result, out text);
            if (!flag || !result)
            {
                return(flag);
            }
        }
        return(flag);
    }