コード例 #1
0
 /// <summary>Initializes a new instance of the <see cref="T:NMasters.Silverlight.Net.Http.Headers.RangeConditionHeaderValue" /> class.</summary>
 public RangeConditionHeaderValue(EntityTagHeaderValue entityTag)
 {
     if (entityTag == null)
     {
         throw new ArgumentNullException("entityTag");
     }
     this.entityTag = entityTag;
 }
コード例 #2
0
 private EntityTagHeaderValue(EntityTagHeaderValue source)
 {
     this.tag = source.tag;
     this.isWeak = source.isWeak;
 }
コード例 #3
0
        internal static int GetEntityTagLength(string input, int startIndex, out EntityTagHeaderValue parsedValue)
        {
            parsedValue = null;
            if (string.IsNullOrEmpty(input) || (startIndex >= input.Length))
            {
                return 0;
            }
            bool flag = false;
            int num = startIndex;
            switch (input[startIndex])
            {
                case '*':
                    parsedValue = Any;
                    num++;
                    goto Label_00BF;

                case 'W':
                case 'w':
                    num++;
                    if (((num + 2) >= input.Length) || (input[num] != '/'))
                    {
                        return 0;
                    }
                    flag = true;
                    num++;
                    num += HttpRuleParser.GetWhitespaceLength(input, num);
                    break;
            }
            int num2 = num;
            int length = 0;
            if (HttpRuleParser.GetQuotedStringLength(input, num, out length) != HttpParseResult.Parsed)
            {
                return 0;
            }
            parsedValue = new EntityTagHeaderValue();
            if (length == input.Length)
            {
                parsedValue.tag = input;
                parsedValue.isWeak = false;
            }
            else
            {
                parsedValue.tag = input.Substring(num2, length);
                parsedValue.isWeak = flag;
            }
            num += length;
            Label_00BF:
            num += HttpRuleParser.GetWhitespaceLength(input, num);
            return (num - startIndex);
        }
コード例 #4
0
 /// <summary>Determines whether a string is valid <see cref="T:NMasters.Silverlight.Net.Http.Headers.EntityTagHeaderValue" /> information.</summary>
 /// <returns>Returns <see cref="T:System.Boolean" />.true if <paramref name="input" /> is valid <see cref="T:NMasters.Silverlight.Net.Http.Headers.EntityTagHeaderValue" /> information; otherwise, false.</returns>
 /// <param name="input">The string to validate.</param>
 /// <param name="parsedValue">The <see cref="T:NMasters.Silverlight.Net.Http.Headers.EntityTagHeaderValue" /> version of the string.</param>
 public static bool TryParse(string input, out EntityTagHeaderValue parsedValue)
 {
     object obj2;
     int index = 0;
     parsedValue = null;
     if (GenericHeaderParser.SingleValueEntityTagParser.TryParseValue(input, null, ref index, out obj2))
     {
         parsedValue = (EntityTagHeaderValue) obj2;
         return true;
     }
     return false;
 }
コード例 #5
0
 private RangeConditionHeaderValue(RangeConditionHeaderValue source)
 {
     this.entityTag = source.entityTag;
     this.date = source.date;
 }