private void CascadeActivation(IActivationContext context)
        {
            IActivationDepth depth = context.Depth();

            if (!depth.RequiresActivation())
            {
                return;
            }
            if (depth.Mode().IsDeactivate())
            {
                Container().StillToDeactivate(_transaction, context.TargetObject(), depth, false);
            }
            else
            {
                // FIXME: [TA] do we really need to check for isValueType here?
                Db4objects.Db4o.Internal.ClassMetadata classMetadata = context.ClassMetadata();
                if (classMetadata.IsStruct())
                {
                    classMetadata.CascadeActivation(context);
                }
                else
                {
                    Container().StillToActivate(context);
                }
            }
        }
Exemple #2
0
		private void CascadeActivation(IActivationContext context)
		{
			IActivationDepth depth = context.Depth();
			if (!depth.RequiresActivation())
			{
				return;
			}
			if (depth.Mode().IsDeactivate())
			{
				Container().StillToDeactivate(_transaction, context.TargetObject(), depth, false);
			}
			else
			{
				// FIXME: [TA] do we really need to check for isValueType here?
				Db4objects.Db4o.Internal.ClassMetadata classMetadata = context.ClassMetadata();
				if (classMetadata.IsStruct())
				{
					classMetadata.CascadeActivation(context);
				}
				else
				{
					Container().StillToActivate(context);
				}
			}
		}
        public virtual void CascadeActivationToChild(object obj)
        {
            if (obj == null)
            {
                return;
            }
            IActivationContext cascadingContext = ForObject(obj);

            Db4objects.Db4o.Internal.ClassMetadata classMetadata = cascadingContext.ClassMetadata
                                                                       ();
            if (classMetadata == null || !classMetadata.HasIdentity())
            {
                return;
            }
            CascadeActivation(cascadingContext.Descend());
        }
        public sealed override void CascadeActivation(IActivationContext context)
        {
            if (!Alive())
            {
                return;
            }
            object cascadeTo = CascadingTarget(context);

            if (cascadeTo == null)
            {
                return;
            }
            IActivationContext cascadeContext = context.ForObject(cascadeTo);
            ClassMetadata      classMetadata  = cascadeContext.ClassMetadata();

            if (classMetadata == null)
            {
                return;
            }
            EnsureObjectIsActive(cascadeContext);
            Handlers4.CascadeActivation(cascadeContext, classMetadata.TypeHandler());
        }
 public virtual void CascadeActivation(IActivationContext context)
 {
     AssertClassMetadata(context.ClassMetadata());
     context.CascadeActivationToTarget();
 }
 public virtual void CascadeActivation(IActivationContext context)
 {
     AssertClassMetadata(context.ClassMetadata());
     context.CascadeActivationToTarget();
 }