Example #1
0
        public IAssetFactory <Asset> GetFactory()
        {
            if (factory != null)
            {
                return(factory);
            }

            if (FactoryTypeName != null)
            {
                factory = AssetRegistry.GetAssetFactory(FactoryTypeName);
            }
            else
            {
                var assetType   = GetAssetType();
                var factoryType = typeof(DefaultAssetFactory <>).MakeGenericType(assetType);
                factory = (IAssetFactory <Asset>)Activator.CreateInstance(factoryType);
            }
            return(factory);
        }