コード例 #1
0
        internal static M3U8TagInstance Create(M3U8Tag tag, string value)
        {
            DateTimeOffset result;

            if (DateTimeOffset.TryParse(value, (IFormatProvider)CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out result))
            {
                return((M3U8TagInstance) new DateTimeTagInstance(tag, result));
            }
            Debug.WriteLine("*** unable to parse date/time: " + value);
            return((M3U8TagInstance)null);
        }
コード例 #2
0
        internal static M3U8TagInstance Create(M3U8Tag tag, string value)
        {
            int length1 = value.IndexOf('@');

            if (length1 < 0 || length1 + 1 >= value.Length)
            {
                return((M3U8TagInstance) new ByterangeTagInstance(tag, long.Parse(value, (IFormatProvider)CultureInfo.InvariantCulture), new long?()));
            }
            long length2 = long.Parse(value.Substring(0, length1), (IFormatProvider)CultureInfo.InvariantCulture);
            long num     = long.Parse(value.Substring(length1 + 1), (IFormatProvider)CultureInfo.InvariantCulture);

            return((M3U8TagInstance) new ByterangeTagInstance(tag, length2, new long?(num)));
        }
コード例 #3
0
        internal static M3U8TagInstance Create(M3U8Tag tag, string value)
        {
            DateTimeOffset dateTimeOffset;

            if (!DateTimeOffset.TryParse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out dateTimeOffset))
            {
                Debug.WriteLine("*** unable to parse date/time: " + value);

                return null;
            }

            return new DateTimeTagInstance(tag, dateTimeOffset);
        }
コード例 #4
0
        internal static M3U8TagInstance Create(M3U8Tag tag, string value)
        {
            // TODO: Consolidate code between ByterangeAttributeInstance and ByterangeTagInstance

            var index = value.IndexOf('@');

            if (index < 0 || index + 1 >= value.Length)
                return new ByterangeTagInstance(tag, long.Parse(value, CultureInfo.InvariantCulture), null);

            var length = long.Parse(value.Substring(0, index), CultureInfo.InvariantCulture);
            var offset = long.Parse(value.Substring(index + 1), CultureInfo.InvariantCulture);

            return new ByterangeTagInstance(tag, length, offset);
        }
コード例 #5
0
        internal static ExtinfTagInstance Create(M3U8Tag tag, string value)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                Debug.WriteLine("*** Invalid empty #EXTINF tag");
                return(new ExtinfTagInstance(tag, new Decimal(0), (string)null));
            }
            int length = value.IndexOf(',');

            if (length < 0)
            {
                return(new ExtinfTagInstance(tag, ExtinfTagInstance.ParseDuration(value), (string)null));
            }
            Decimal duration = ExtinfTagInstance.ParseDuration(value.Substring(0, length));
            string  title    = string.Empty;

            if (length + 1 < value.Length)
            {
                title = value.Substring(length + 1).Trim();
            }
            return(new ExtinfTagInstance(tag, duration, title));
        }
コード例 #6
0
ファイル: ExtKeyTagInstance.cs プロジェクト: henricj/phonesm
 public static ExtKeyTagInstance Create(M3U8Tag tag, string value)
 {
     return new ExtKeyTagInstance(tag, ParseAttributes(value, ExtKeySupport.Attributes));
 }
コード例 #7
0
ファイル: ExtKeyTagInstance.cs プロジェクト: henricj/phonesm
 internal ExtKeyTagInstance(M3U8Tag tag, IEnumerable<M3U8AttributeInstance> attributes)
     : base(tag, attributes)
 { }
コード例 #8
0
 public M3U8TagInstance(M3U8Tag tag)
 {
     this.Tag = tag;
 }
コード例 #9
0
 public ByterangeTagInstance(M3U8Tag tag, long length, long? offset)
     : base(tag)
 {
     Length = length;
     Offset = offset;
 }
コード例 #10
0
ファイル: ValueTagInstance.cs プロジェクト: henricj/phonesm
 ValueTagInstance(M3U8Tag tag, object value)
     : base(tag)
 {
     Value = value;
 }
コード例 #11
0
 public static ExtStreamInfTagInstance Create(M3U8Tag tag, string value)
 {
     return(new ExtStreamInfTagInstance(tag, AttributesTagInstance.ParseAttributes(value, ExtStreamInfSupport.Attributes)));
 }
コード例 #12
0
 internal static ValueTagInstance CreateLong(M3U8Tag tag, string value)
 {
     return(ValueTagInstance.Create(tag, value, (Func <string, object>)(v => (object)long.Parse(v, (IFormatProvider)CultureInfo.InvariantCulture))));
 }
コード例 #13
0
 internal static M3U8TagInstance Create(M3U8Tag tag, string value)
 {
     return((M3U8TagInstance) new MapTagInstance(tag));
 }
コード例 #14
0
 private MapTagInstance(M3U8Tag tag)
     : base(tag)
 {
 }
コード例 #15
0
 public ExtinfTagInstance(M3U8Tag tag, Decimal duration, string title = null)
     : base(tag)
 {
     this.Duration = duration;
     this.Title    = title ?? string.Empty;
 }
コード例 #16
0
 private static M3U8TagInstance Create(M3U8Tag tag, string value, Func <string, IEnumerable <M3U8AttributeInstance> > attributeParser)
 {
     return((M3U8TagInstance) new AttributesTagInstance(tag, AttributesTagInstance.ParseAttributes(value, attributeParser)));
 }
コード例 #17
0
 public static M3U8TagInstance Create(M3U8Tag tag, string value, IDictionary <string, M3U8Attribute> attributes)
 {
     return(AttributesTagInstance.Create(tag, value, (Func <string, IEnumerable <M3U8AttributeInstance> >)(v => M3U8AttributeParserSupport.ParseAttributes(v, attributes))));
 }
コード例 #18
0
 internal AttributesTagInstance(M3U8Tag tag, IEnumerable <M3U8AttributeInstance> attributes)
     : base(tag)
 {
     this.Attributes = attributes;
 }
コード例 #19
0
 private ValueTagInstance(M3U8Tag tag, object value)
     : base(tag)
 {
     this.Value = value;
 }
コード例 #20
0
 public DateTimeTagInstance(M3U8Tag tag, DateTimeOffset dateTime)
     : base(tag)
 {
     this.DateTime = dateTime;
 }
コード例 #21
0
 internal static ValueTagInstance Create(M3U8Tag tag, string value, Func <string, object> valueParser)
 {
     return(new ValueTagInstance(tag, valueParser(value)));
 }
コード例 #22
0
ファイル: ValueTagInstance.cs プロジェクト: henricj/phonesm
 internal static ValueTagInstance Create(M3U8Tag tag, string value, Func<string, object> valueParser)
 {
     return new ValueTagInstance(tag, valueParser(value));
 }
コード例 #23
0
 internal ExtStreamInfTagInstance(M3U8Tag tag, IEnumerable <M3U8AttributeInstance> attributes)
     : base(tag, attributes)
 {
 }
コード例 #24
0
 public DateTimeTagInstance(M3U8Tag tag, DateTimeOffset dateTime)
     : base(tag)
 {
     DateTime = dateTime;
 }
コード例 #25
0
 public ByterangeTagInstance(M3U8Tag tag, long length, long?offset)
     : base(tag)
 {
     this.Length = length;
     this.Offset = offset;
 }
コード例 #26
0
 public static M3U8TagInstance CreateInstance(M3U8Tag tag, string value)
 {
     return(new M3U8TagInstance(tag));
 }
コード例 #27
0
ファイル: M3U8TagInstance.cs プロジェクト: henricj/phonesm
 public M3U8TagInstance(M3U8Tag tag)
 {
     Tag = tag;
 }
コード例 #28
0
ファイル: MapTagInstance.cs プロジェクト: henricj/phonesm
 internal static M3U8TagInstance Create(M3U8Tag tag, string value)
 {
     return new MapTagInstance(tag);
 }
コード例 #29
0
 internal AttributesTagInstance(M3U8Tag tag, IEnumerable<M3U8AttributeInstance> attributes)
     : base(tag)
 {
     Attributes = attributes;
 }
コード例 #30
0
ファイル: ValueTagInstance.cs プロジェクト: henricj/phonesm
 internal static ValueTagInstance CreateLong(M3U8Tag tag, string value)
 {
     return Create(tag, value, v => long.Parse(v, CultureInfo.InvariantCulture));
 }
コード例 #31
0
 public static M3U8TagInstance Create(M3U8Tag tag, string value, IDictionary<string, M3U8Attribute> attributes)
 {
     return Create(tag, value, v => M3U8AttributeParserSupport.ParseAttributes(v, attributes));
 }
コード例 #32
0
 static M3U8TagInstance Create(M3U8Tag tag, string value, Func<string, IEnumerable<M3U8AttributeInstance>> attributeParser)
 {
     return new AttributesTagInstance(tag, ParseAttributes(value, attributeParser));
 }
コード例 #33
0
 public static M3U8TagInstance CreateInstance(M3U8Tag tag, string value)
 {
     return new M3U8TagInstance(tag);
 }
コード例 #34
0
ファイル: MapTagInstance.cs プロジェクト: henricj/phonesm
 MapTagInstance(M3U8Tag tag)
     : base(tag)
 { }