Пример #1
0
        public static TValue AttributeObject <TValue>(this M3U8TagInstance tagInstance, M3U8ValueAttribute <TValue> attribute) where TValue : class
        {
            M3U8AttributeValueInstance <TValue> attributeValueInstance = M3U8TagInstanceExtensions.Attribute <TValue>(tagInstance, attribute);

            if (null == attributeValueInstance)
            {
                return(default(TValue));
            }
            return(attributeValueInstance.Value);
        }
Пример #2
0
        public static TValue?AttributeValue <TValue>(this M3U8TagInstance tagInstance, M3U8ValueAttribute <TValue> attribute) where TValue : struct
        {
            M3U8AttributeValueInstance <TValue> attributeValueInstance = M3U8TagInstanceExtensions.Attribute <TValue>(tagInstance, attribute);

            if (null == attributeValueInstance)
            {
                return(new TValue?());
            }
            return(new TValue?(attributeValueInstance.Value));
        }
Пример #3
0
 public static M3U8AttributeValueInstance <TValue> Attribute <TValue>(this M3U8TagInstance tagInstance, M3U8ValueAttribute <TValue> attribute, TValue value) where TValue : IEquatable <TValue>
 {
     return(Enumerable.FirstOrDefault <M3U8AttributeValueInstance <TValue> >(Enumerable.OfType <M3U8AttributeValueInstance <TValue> >((IEnumerable)M3U8TagInstanceExtensions.Attributes(tagInstance)), (Func <M3U8AttributeValueInstance <TValue>, bool>)(a => a.Attribute == (M3U8Attribute)attribute && a.Value.Equals(value))));
 }
Пример #4
0
 public static IEnumerable <M3U8AttributeValueInstance <TValue> > Attributes <TValue>(this M3U8TagInstance tagInstance, M3U8ValueAttribute <TValue> attribute)
 {
     return(Enumerable.Where <M3U8AttributeValueInstance <TValue> >(Enumerable.OfType <M3U8AttributeValueInstance <TValue> >((IEnumerable)M3U8TagInstanceExtensions.Attributes(tagInstance)), (Func <M3U8AttributeValueInstance <TValue>, bool>)(a => a.Attribute == (M3U8Attribute)attribute)));
 }
Пример #5
0
 public static TInstance AttributeInstance <TInstance>(this M3U8TagInstance tagInstance, M3U8Attribute attribute) where TInstance : M3U8AttributeInstance
 {
     return(Enumerable.FirstOrDefault <M3U8AttributeInstance>(M3U8TagInstanceExtensions.Attributes(tagInstance), (Func <M3U8AttributeInstance, bool>)(a => a.Attribute == attribute)) as TInstance);
 }
Пример #6
0
 public static IEnumerable <M3U8AttributeInstance> Attributes(this M3U8TagInstance tagInstance, M3U8Attribute attribute)
 {
     return(Enumerable.Where <M3U8AttributeInstance>(M3U8TagInstanceExtensions.Attributes(tagInstance), (Func <M3U8AttributeInstance, bool>)(a => a.Attribute == attribute)));
 }