示例#1
0
 internal MetadataProperties Initialize(Stream streamValidator = null)
 {
     using (var stream = MetadataParsingUtils.GetStream(streamValidator, Properties)) {
         var metadata = new XmlPropertyMetadataParser().Parse(stream);
         metadata.ValidateRequiredProperties();
         return(metadata);
     }
 }
示例#2
0
 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);
 }
示例#3
0
        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);
        }