Exemplo n.º 1
0
        internal InjectionContext(InjectionContext context, ObjectDescription description, ParameterSet parameters)
        {
            _parentContext = context;
            _scope         = context.LifetimeScope;

            _description = description;
            _parameters  = parameters;
        }
Exemplo n.º 2
0
        protected InjectionContext DoFindMatchingContext(ObjectDescription description)
        {
            var context = ParentContext;

            if (context == null)
            {
                return(null);
            }
            if (ReferenceEquals(context.ObjectDescription, description))
            {
                return(context);
            }

            context = context.ParentContext;
            if (context == null)
            {
                return(null);
            }
            if (ReferenceEquals(context.ObjectDescription, description))
            {
                return(context);
            }

            context = context.ParentContext;
            if (context == null)
            {
                return(null);
            }
            if (ReferenceEquals(context.ObjectDescription, description))
            {
                return(context);
            }

            context = context.ParentContext;
            while (context != null)
            {
                if (ReferenceEquals(context.ObjectDescription, description))
                {
                    return(context);
                }
            }

            return(null);
        }
 internal InjectionOperator(ObjectDescription description)
 {
     _description = description;
 }
 internal InjectionOperatorBuilder(ObjectBuilder <T> builder, ObjectDescription description, Lifetime <T> lifetime, InjectionConfigurationSet configurationSet)
     : base(builder, description, lifetime)
 {
     _configurationSet = configurationSet;
 }
Exemplo n.º 5
0
        // Create a ViralSharedInjectionContext to build the instance, no matter what kind of InjectionContext the current context is
        public TCurrent BuildAndShareInstance <TCurrent>(InjectionProcess <TCurrent> process, ObjectDescription description, ParameterSet parameters)
        {
            var myContext = new ViralSharedInjectionContext <TCurrent>(this, description, parameters);

            process.Execute(myContext);
            return(myContext.Instance);
        }
Exemplo n.º 6
0
 // Create a NonViralSharedInjectionContext to build the instance, but if the current context is already a ViralSharedInjectionContext,
 // then it will create a ViralSharedInjectionContext also
 public abstract TCurrent BuildInstance <TCurrent>(InjectionProcess <TCurrent> process,
                                                   ObjectDescription description, ParameterSet parameters);
Exemplo n.º 7
0
 public InjectionContext ForceFindMatchingContext(ObjectDescription description)
 {
     return(DoFindMatchingContext(description));
 }
Exemplo n.º 8
0
 public override InjectionContext FindMatchingContext(ObjectDescription description)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 internal InjectionContext(ISharingLifetimeScope scope, ObjectDescription description, ParameterSet parameters)
 {
     _scope       = scope;
     _description = description;
     _parameters  = parameters;
 }
Exemplo n.º 10
0
 public override InjectionContext FindMatchingContext(ObjectDescription description)
 {
     return(DoFindMatchingContext(description));
 }
Exemplo n.º 11
0
 internal ViralSharedInjectionContext(ISharingLifetimeScope scope, ObjectDescription description, ParameterSet parameters)
     : base(scope, description, parameters)
 {
 }
Exemplo n.º 12
0
 internal ViralSharedInjectionContext(InjectionContext context, ObjectDescription description, ParameterSet parameters)
     : base(context, description, parameters)
 {
 }
Exemplo n.º 13
0
 public override TCurrent BuildInstance <TCurrent>(InjectionProcess <TCurrent> process, ObjectDescription description, ParameterSet parameters)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 14
0
 public SharedInjectionOperator(ObjectBuilder <T> builder, ObjectDescription description, Lifetime <T> lifetime, InjectionProcess <T> process)
     : base(builder, description, lifetime)
 {
     _process = process;
 }
Exemplo n.º 15
0
 public abstract InjectionContext FindMatchingContext(ObjectDescription description);
Exemplo n.º 16
0
 internal UnreadyInjectionOperator(ObjectBuilder <T> builder, ObjectDescription description, Lifetime <T> lifetime)
     : base(builder, description, lifetime)
 {
 }
Exemplo n.º 17
0
 internal FakeInjectionContext(InjectionContext context, ObjectDescription description, ParameterSet parameters)
     : base(context, description, parameters)
 {
 }