/// <summary>
 /// Configures the player with a dynamic metadata file
 /// </summary>
 public void Setup(AvailablePlayerType playerType, RenderType renderType, string metadataPath)
 {
     Setup(playerType, renderType);
     _metaDataSourceType = MetadataSourceType.FilePath;
     _metaDataFilePath   = metadataPath;
     RefreshMetaData();
 }
 /// <summary>
 /// Configures the player with a TextAsset resource
 /// </summary>
 public void Setup(AvailablePlayerType playerType, RenderType renderType, TextAsset metadata)
 {
     Setup(playerType, renderType);
     _metaDataSourceType = MetadataSourceType.TextAsset;
     _metaDataFile       = metadata;
     RefreshMetaData();
 }
Example #3
0
        private IMapper GetModelConfigMapper(MetadataSourceType sourceType)
        {
            var modelConfigMapperConfig = new MapperConfiguration(cfg => {
                var mapExpression = cfg.CreateMap <ModelConfigurationDto, EntityConfig>()
                                    .ForMember(d => d.Id, o => o.Ignore());

                if (sourceType == MetadataSourceType.ApplicationCode)
                {
                    mapExpression.ForMember(d => d.ClassName, o => o.Ignore());
                    mapExpression.ForMember(d => d.Namespace, o => o.Ignore());
                }
            });

            return(modelConfigMapperConfig.CreateMapper());
        }
Example #4
0
        private IMapper GetPropertyMapper(MetadataSourceType sourceType)
        {
            var propertyMapperConfig = new MapperConfiguration(cfg => {
                var mapExpression = cfg.CreateMap <ModelPropertyDto, EntityProperty>()
                                    .ForMember(d => d.Id, o => o.Ignore())
                                    .ForMember(d => d.EntityConfig, o => o.Ignore())
                                    .ForMember(d => d.SortOrder, o => o.Ignore())
                                    .ForMember(d => d.Properties, o => o.Ignore())
                                    .ForMember(d => d.Source, o => o.Ignore());

                if (sourceType == MetadataSourceType.ApplicationCode)
                {
                    mapExpression.ForMember(d => d.Name, o => o.Ignore());
                    mapExpression.ForMember(d => d.DataType, o => o.Ignore());
                    mapExpression.ForMember(d => d.EntityType, o => o.Ignore());
                }
            });

            return(propertyMapperConfig.CreateMapper());
        }