Esempio n. 1
0
 private PolicyDefinition AddElement <T, TElement>(
     string name,
     LifetimeManager lifetimeManager,
     InjectionMember[] injectionMembers,
     UpdateElements update)
     where TElement : T
 {
     return(AddElement <T>(typeof(TElement), name, lifetimeManager, injectionMembers, update));
 }
Esempio n. 2
0
        private PolicyDefinition AddElement <T>(T instance, UpdateElements update)
        {
            Guard.ArgumentNotNull(instance, "instance");

            string newName = NewName();

            Container.RegisterInstance(newName, instance);

            return(update(newName));
        }
Esempio n. 3
0
        private PolicyDefinition AddElement <T>(
            Type type,
            string name,
            LifetimeManager lifetimeManager,
            InjectionMember[] injectionMembers,
            UpdateElements update)
        {
            Guard.ArgumentNotNullOrEmpty(name, "name");
            Guard.ArgumentNotNull(type, "type");
            Guard.TypeIsAssignable(typeof(T), type, "type");
            Guard.ArgumentNotNull(injectionMembers, "injectionMembers");

            Container.RegisterType(typeof(T), type, name, (ITypeLifetimeManager)lifetimeManager, injectionMembers);

            return(update(name));
        }
Esempio n. 4
0
 ///  LateUpdate is called once per frame after all regular calculations.
 /// The order of events in code and the fact that they are all in one method guarantees
 /// right execution order of integrity checks.
 void LateUpdate()
 {
     UpdateElements?.Invoke();
     UpdateConstructions?.Invoke();
     UpdateStructures?.Invoke();
 }
Esempio n. 5
0
        private PolicyDefinition AddElement <T>(string name, UpdateElements update)
        {
            Guard.ArgumentNotNull(name, "name");

            return(update(name));
        }