internal MetadataProperties Initialize(Stream streamValidator = null) { using (var stream = MetadataParsingUtils.GetStream(streamValidator, Properties)) { var metadata = new XmlPropertyMetadataParser().Parse(stream); metadata.ValidateRequiredProperties(); return(metadata); } }
internal MenuDefinition InitializeMenu(ClientPlatform platform, Stream streamValidator = null) { try { using (var stream = MetadataParsingUtils.GetStream(streamValidator, String.Format(MenuPattern, platform.ToString().ToLower()))) { return(stream == null ? null : new XmlMenuMetadataParser().Parse(stream)); } } catch (Exception) { Log.Warn(String.Format("menu.{0}.xml not found", platform)); } return(null); }
internal static IReadOnlyCollection <CompleteApplicationMetadataDefinition> InitializeApplicationMetadata([NotNull] IEnumerable <EntityMetadata> entityMetadata, Stream streamValidator = null) { if (entityMetadata == null) { throw new ArgumentNullException("entityMetadata"); } var applicationMetadata = new List <CompleteApplicationMetadataDefinition>(); var parser = new XmlApplicationMetadataParser(entityMetadata); using (var stream = MetadataParsingUtils.GetStream(streamValidator, Metadata)) { applicationMetadata.AddRange(parser.Parse(stream)); } return(applicationMetadata); }