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)); }
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))); }
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))); }