当前位置: 首页>>代码示例>>C#>>正文


C# IActivationContext.Depth方法代码示例

本文整理汇总了C#中IActivationContext.Depth方法的典型用法代码示例。如果您正苦于以下问题:C# IActivationContext.Depth方法的具体用法?C# IActivationContext.Depth怎么用?C# IActivationContext.Depth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IActivationContext的用法示例。


在下文中一共展示了IActivationContext.Depth方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CascadeActivation

		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);
				}
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:25,代码来源:ActivationContext4.cs

示例2: Deactivate

		public override void Deactivate(IActivationContext context)
		{
			if (context.Depth().RequiresActivation())
			{
				CascadeActivation(context);
			}
			SetOn(context.Transaction(), context.TargetObject(), null);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:8,代码来源:TranslatedAspect.cs

示例3: ProcessedByImmediateActivation

		private bool ProcessedByImmediateActivation(IActivationContext context)
		{
			if (!StackIsSmall())
			{
				return false;
			}
			if (!context.Depth().RequiresActivation())
			{
				return true;
			}
			ObjectReference @ref = context.Transaction().ReferenceForObject(context.TargetObject
				());
			if (@ref == null)
			{
				return false;
			}
			if (HandledInCurrentTopLevelCall(@ref))
			{
				return true;
			}
			FlagAsHandled(@ref);
			IncStackDepth();
			try
			{
				@ref.ActivateInternal(context);
			}
			finally
			{
				DecStackDepth();
			}
			return true;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:32,代码来源:ObjectContainerBase.cs

示例4: StillToActivate

		public void StillToActivate(IActivationContext context)
		{
			// TODO: We don't want the simple classes to search the hc_tree
			// Kick them out here.
			//		if (a_object != null) {
			//			Class clazz = a_object.getClass();
			//			if(! clazz.isPrimitive()){
			if (ProcessedByImmediateActivation(context))
			{
				return;
			}
			_stillToActivate = StillTo1(context.Transaction(), _stillToActivate, context.TargetObject
				(), context.Depth());
		}
开发者ID:erdincay,项目名称:db4o,代码行数:14,代码来源:ObjectContainerBase.cs

示例5: ReadForActivation

		private void ReadForActivation(IActivationContext context)
		{
			Read(context.Transaction(), null, context.TargetObject(), context.Depth(), Const4
				.AddMembersToIdTreeOnly, false);
		}
开发者ID:Galigator,项目名称:db4o,代码行数:5,代码来源:ObjectReference.cs

示例6: ActivateInternal

		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);
		}
开发者ID:Galigator,项目名称:db4o,代码行数:26,代码来源:ObjectReference.cs

示例7: Deactivate

		public override void Deactivate(IActivationContext context)
		{
			if (!Alive() || !ShouldStoreField())
			{
				return;
			}
			bool isEnumClass = _containingClass.IsEnum();
			if (_isPrimitive && !_isArray)
			{
				if (!isEnumClass)
				{
					object nullValue = _reflectField.GetFieldType().NullValue();
					FieldAccessor().Set(_reflectField, context.TargetObject(), nullValue);
				}
				return;
			}
			if (context.Depth().RequiresActivation())
			{
				CascadeActivation(context);
			}
			if (!isEnumClass)
			{
				FieldAccessor().Set(_reflectField, context.TargetObject(), null);
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:25,代码来源:FieldMetadata.cs

示例8: CascadingTarget

		protected object CascadingTarget(IActivationContext context)
		{
			if (context.Depth().Mode().IsDeactivate())
			{
				if (null == _reflectField)
				{
					return null;
				}
				return FieldAccessor().Get(_reflectField, context.TargetObject());
			}
			return GetOrCreate(context.Transaction(), context.TargetObject());
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:12,代码来源:FieldMetadata.cs

示例9: EnsureObjectIsActive

		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());
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:23,代码来源:FieldMetadata.cs


注:本文中的IActivationContext.Depth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。