Beispiel #1
0
        static ContentComponent LoadContentComponent(XElement element)
        {
            var ns     = element.GetDefaultNamespace().NamespaceName;
            var result = new ContentComponent();

            result.Id          = element.Attribute("id").GetNullableUInt();
            result.Lang        = (string)element.Attribute("lang");
            result.ContentType = (string)element.Attribute("contentType");
            result.Par         = (string)element.Attribute("par");
            result.AnyAttr.AddRange(element.Attributes());

            result.Accessibility.AddRange(element.Elements(XName.Get("Accessibility", ns)).Select(LoadDescriptor));
            result.Role.AddRange(element.Elements(XName.Get("Role", ns)).Select(LoadDescriptor));
            result.Rating.AddRange(element.Elements(XName.Get("Rating", ns)).Select(LoadDescriptor));
            result.Viewpoint.AddRange(element.Elements(XName.Get("Viewpoint", ns)).Select(LoadDescriptor));
            result.Any.AddRange(element.Elements());

            return(result);
        }
        static ContentComponent LoadContentComponent(XElement element)
        {
            var ns = element.GetDefaultNamespace().NamespaceName;
            var result = new ContentComponent();

            result.Id = element.Attribute("id").GetNullableUInt();
            result.Lang = (string)element.Attribute("lang");
            result.ContentType = (string)element.Attribute("contentType");
            result.Par = (string)element.Attribute("par");
            result.AnyAttr.AddRange(element.Attributes());

            result.Accessibility.AddRange(element.Elements(XName.Get("Accessibility", ns)).Select(LoadDescriptor));
            result.Role.AddRange(element.Elements(XName.Get("Role", ns)).Select(LoadDescriptor));
            result.Rating.AddRange(element.Elements(XName.Get("Rating", ns)).Select(LoadDescriptor));
            result.Viewpoint.AddRange(element.Elements(XName.Get("Viewpoint", ns)).Select(LoadDescriptor));
            result.Any.AddRange(element.Elements());

            return result;
        }