Beispiel #1
0
        internal static VisualElements Parse(string Xml)
        {
            var Manifest = XDocument.Parse(Xml);

            var VisualElements = EnumCollector.Collect <VisualElementType>()
                                 .Where(VisualElement => Utils.HasVisualElement(Manifest, VisualElement))
                                 .Select(VisualElement => Utils.GetVisualElement(Manifest, VisualElement))
                                 .ToDictionary(Pair => Pair.Key, Pair => Pair.Value);

            return(new VisualElements(VisualElements));
        }
Beispiel #2
0
 private static bool ValidateValueSet(XDocument Manifest)
 {
     return(EnumCollector.Collect <VisualElementType>().Where(Type => Utils.HasVisualElement(Manifest, Type)).All(Type => StringValidator.Validate(Utils.GetVisualElement(Manifest, Type).Value, Data.PATTERNS[Type], false)));
 }
Beispiel #3
0
 private static bool ValidateAttributeSet(XDocument Manifest)
 {
     return(EnumCollector.Collect <VisualElementType>().Where(PropertyType => Data.REQUIREMENTS[PropertyType] == false).Any(Type => Utils.HasVisualElement(Manifest, Type)) ? EnumCollector.Collect <VisualElementType>().All(Type => Utils.HasVisualElement(Manifest, Type)) : EnumCollector.Collect <VisualElementType>().Where(PropertyType => Data.REQUIREMENTS[PropertyType] == true).All(Type => Utils.HasVisualElement(Manifest, Type)));
 }