internal InjectionContext(InjectionContext context, ObjectDescription description, ParameterSet parameters)
        {
            _parentContext = context;
            _scope         = context.LifetimeScope;

            _description = description;
            _parameters  = parameters;
        }
        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;
 }
        // 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);
        }
 // 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);
 public InjectionContext ForceFindMatchingContext(ObjectDescription description)
 {
     return(DoFindMatchingContext(description));
 }
 public override InjectionContext FindMatchingContext(ObjectDescription description)
 {
     throw new NotImplementedException();
 }
 internal InjectionContext(ISharingLifetimeScope scope, ObjectDescription description, ParameterSet parameters)
 {
     _scope       = scope;
     _description = description;
     _parameters  = parameters;
 }
 public override InjectionContext FindMatchingContext(ObjectDescription description)
 {
     return(DoFindMatchingContext(description));
 }
 internal ViralSharedInjectionContext(ISharingLifetimeScope scope, ObjectDescription description, ParameterSet parameters)
     : base(scope, description, parameters)
 {
 }
 internal ViralSharedInjectionContext(InjectionContext context, ObjectDescription description, ParameterSet parameters)
     : base(context, description, parameters)
 {
 }
 public override TCurrent BuildInstance <TCurrent>(InjectionProcess <TCurrent> process, ObjectDescription description, ParameterSet parameters)
 {
     throw new NotImplementedException();
 }
 public SharedInjectionOperator(ObjectBuilder <T> builder, ObjectDescription description, Lifetime <T> lifetime, InjectionProcess <T> process)
     : base(builder, description, lifetime)
 {
     _process = process;
 }
 public abstract InjectionContext FindMatchingContext(ObjectDescription description);
 internal UnreadyInjectionOperator(ObjectBuilder <T> builder, ObjectDescription description, Lifetime <T> lifetime)
     : base(builder, description, lifetime)
 {
 }
 internal FakeInjectionContext(InjectionContext context, ObjectDescription description, ParameterSet parameters)
     : base(context, description, parameters)
 {
 }