Beispiel #1
0
        internal virtual void ActivateInternal(IActivationContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException();
            }
            if (!context.Depth().RequiresActivation())
            {
                return;
            }
            ObjectContainerBase container = context.Container();

            if (context.Depth().Mode().IsRefresh())
            {
                LogActivation(container, "refresh");
            }
            else
            {
                if (IsActive())
                {
                    _class.CascadeActivation(context);
                    return;
                }
                LogActivation(container, "activate");
            }
            ReadForActivation(context);
        }
		public void CascadeActivation(IActivationContext context)
		{
			if (!Handlers4.IsCascading(_handler))
			{
				return;
			}
			ObjectContainerBase container = context.Container();
			IEnumerator all = AllElements(container, context.TargetObject());
			while (all.MoveNext())
			{
				context.CascadeActivationToChild(all.Current);
			}
		}
        public void CascadeActivation(IActivationContext context)
        {
            if (!Handlers4.IsCascading(_handler))
            {
                return;
            }
            ObjectContainerBase container = context.Container();
            IEnumerator         all       = AllElements(container, context.TargetObject());

            while (all.MoveNext())
            {
                context.CascadeActivationToChild(all.Current);
            }
        }
        private void EnsureObjectIsActive(IActivationContext context)
        {
            if (!context.Depth().Mode().IsActivate())
            {
                return;
            }
            if (Handlers4.IsValueType(GetHandler()))
            {
                return;
            }
            ObjectContainerBase container     = context.Container();
            ClassMetadata       classMetadata = container.ClassMetadataForObject(context.TargetObject
                                                                                     ());

            if (classMetadata == null || !classMetadata.HasIdentity())
            {
                return;
            }
            if (container.IsActive(context.TargetObject()))
            {
                return;
            }
            container.StillToActivate(context.Descend());
        }
Beispiel #5
0
		internal virtual void ActivateInternal(IActivationContext context)
		{
			if (null == context)
			{
				throw new ArgumentNullException();
			}
			if (!context.Depth().RequiresActivation())
			{
				return;
			}
			ObjectContainerBase container = context.Container();
			if (context.Depth().Mode().IsRefresh())
			{
				LogActivation(container, "refresh");
			}
			else
			{
				if (IsActive())
				{
					_class.CascadeActivation(context);
					return;
				}
				LogActivation(container, "activate");
			}
			ReadForActivation(context);
		}
		private void EnsureObjectIsActive(IActivationContext context)
		{
			if (!context.Depth().Mode().IsActivate())
			{
				return;
			}
			if (Handlers4.IsValueType(GetHandler()))
			{
				return;
			}
			ObjectContainerBase container = context.Container();
			ClassMetadata classMetadata = container.ClassMetadataForObject(context.TargetObject
				());
			if (classMetadata == null || !classMetadata.HasIdentity())
			{
				return;
			}
			if (container.IsActive(context.TargetObject()))
			{
				return;
			}
			container.StillToActivate(context.Descend());
		}