コード例 #1
0
        /// <summary>Initializes the <see cref="EntityFactoryFactory"/> class.</summary>
        static EntityFactoryFactory()
        {
            Array entityTypeValues = Enum.GetValues(typeof(NinjaSoftware.EnioNg.CoolJ.EntityType));

            foreach (int entityTypeValue in entityTypeValues)
            {
                IEntity2 dummy = GeneralEntityFactory.Create((NinjaSoftware.EnioNg.CoolJ.EntityType)entityTypeValue);
                _factoryPerType.Add(dummy.GetType(), dummy.GetEntityFactory());
            }
        }
コード例 #2
0
 /// <summary>Gets the factory of the entity with the NinjaSoftware.EnioNg.CoolJ.EntityType specified</summary>
 /// <param name="typeOfEntity">The type of entity.</param>
 /// <returns>factory to use or null if not found</returns>
 public static IEntityFactory2 GetFactory(NinjaSoftware.EnioNg.CoolJ.EntityType typeOfEntity)
 {
     return(GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType()));
 }
コード例 #3
0
 /// <summary>Creates a new entity instance using the GeneralEntityFactory in the generated code, using the passed in entitytype value</summary>
 /// <param name="entityTypeValue">The entity type value of the entity to create an instance for.</param>
 /// <returns>new IEntity instance</returns>
 public override IEntity2 CreateEntityFromEntityTypeValue(int entityTypeValue)
 {
     return(GeneralEntityFactory.Create((NinjaSoftware.EnioNg.CoolJ.EntityType)entityTypeValue));
 }