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


C# ObjectReference.ClassMetadata方法代码示例

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


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

示例1: WriteAndRead

 private object WriteAndRead(object obj)
 {
     var imaginativeID = 500;
     var @ref = new ObjectReference(ClassMetadataForObject(obj), imaginativeID
         );
     @ref.SetObject(obj);
     var marshallingContext = new MarshallingContext(Trans(), @ref, Container
         ().UpdateDepthProvider().ForDepth(int.MaxValue), true);
     Handlers4.Write(@ref.ClassMetadata().TypeHandler(), marshallingContext, obj);
     var pointer = marshallingContext.AllocateSlot();
     var buffer = marshallingContext.ToWriteBuffer(pointer);
     buffer.Seek(0);
     //        String str = new String(buffer._buffer);
     //        System.out.println(str);
     var unmarshallingContext = new UnmarshallingContext(Trans(), @ref
         , Const4.AddToIdTree, false);
     unmarshallingContext.Buffer(buffer);
     unmarshallingContext.ActivationDepth(new LegacyActivationDepth(5));
     return unmarshallingContext.Read();
 }
开发者ID:masroore,项目名称:db4o,代码行数:20,代码来源:MarshallingContextTestCase.cs

示例2: Analyze

		internal virtual void Analyze(Transaction trans)
		{
			_ref = trans.ReferenceForObject(_obj);
			if (_ref != null)
			{
				_classMetadata = _ref.ClassMetadata();
				return;
			}
			IReflectClass claxx = _container.Reflector().ForObject(_obj);
			if (claxx == null)
			{
				NotStorable(_obj, claxx);
				return;
			}
			if (!DetectClassMetadata(trans, claxx))
			{
				return;
			}
			if (IsValueType(_classMetadata))
			{
				NotStorable(_obj, _classMetadata.ClassReflector());
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:23,代码来源:ObjectAnalyzer.cs

示例3: Delete3

		internal void Delete3(Transaction trans, ObjectReference @ref, object obj, int cascade
			, bool userCall)
		{
			// The passed reference can be null, when calling from Transaction.
			if (@ref == null || [email protected]())
			{
				return;
			}
			// This check is performed twice, here and in delete2, intentionally.
			if (BreakDeleteForEnum(@ref, userCall))
			{
				@ref.EndProcessing();
				return;
			}
			if ([email protected]())
			{
				@ref.EndProcessing();
				return;
			}
			ClassMetadata yc = @ref.ClassMetadata();
			// We have to end processing temporarily here, otherwise the can delete callback
			// can't do anything at all with this object.
			@ref.EndProcessing();
			ActivateForDeletionCallback(trans, yc, @ref, obj);
			if (!ObjectCanDelete(trans, yc, @ref))
			{
				return;
			}
			@ref.BeginProcessing();
			if (DTrace.enabled)
			{
				DTrace.Delete.Log(@ref.GetID());
			}
			if (Delete4(trans, @ref, obj, cascade, userCall))
			{
				ObjectOnDelete(trans, yc, @ref);
				if (ConfigImpl.MessageLevel() > Const4.State)
				{
					Message(string.Empty + @ref.GetID() + " delete " + @ref.ClassMetadata().GetName()
						);
				}
			}
			@ref.EndProcessing();
		}
开发者ID:erdincay,项目名称:db4o,代码行数:44,代码来源:ObjectContainerBase.cs

示例4: BreakDeleteForEnum

		private bool BreakDeleteForEnum(ObjectReference reference, bool userCall)
		{
			return false;
			if (userCall)
			{
				return false;
			}
			if (reference == null)
			{
				return false;
			}
			return Platform4.IsEnum(Reflector(), reference.ClassMetadata().ClassReflector());
		}
开发者ID:erdincay,项目名称:db4o,代码行数:13,代码来源:ObjectContainerBase.cs

示例5: Store2

		public int Store2(Transaction trans, object obj, IUpdateDepth updateDepth, bool checkJustSet
			)
		{
			if (obj == null || (obj is ITransientClass))
			{
				return 0;
			}
			ObjectAnalyzer analyzer = new ObjectAnalyzer(this, obj);
			analyzer.Analyze(trans);
			if (analyzer.NotStorable())
			{
				return 0;
			}
			ObjectReference @ref = analyzer.ObjectReference();
			if (@ref == null)
			{
				ClassMetadata classMetadata = analyzer.ClassMetadata();
				if (!ObjectCanNew(trans, classMetadata, obj))
				{
					return 0;
				}
				@ref = new ObjectReference();
				@ref.Store(trans, classMetadata, obj);
				trans.AddNewReference(@ref);
				if (obj is IDb4oTypeImpl)
				{
					((IDb4oTypeImpl)obj).SetTrans(trans);
				}
				if (ConfigImpl.MessageLevel() > Const4.State)
				{
					Message(string.Empty + @ref.GetID() + " new " + @ref.ClassMetadata().GetName());
				}
				FlagAsHandled(@ref);
				StillToSet(trans, @ref, updateDepth);
			}
			else
			{
				if (@ref.IsFlaggedAsHandled(_topLevelCallId))
				{
					AssertNotInCallback();
				}
				if (CanUpdate())
				{
					if (checkJustSet)
					{
						if (([email protected]()) && HandledInCurrentTopLevelCall(@ref))
						{
							return @ref.GetID();
						}
					}
					if (updateDepth.SufficientDepth())
					{
						FlagAsHandled(@ref);
						@ref.WriteUpdate(trans, updateDepth);
					}
				}
			}
			ProcessPendingClassUpdates();
			return @ref.GetID();
		}
开发者ID:erdincay,项目名称:db4o,代码行数:60,代码来源:ObjectContainerBase.cs

示例6: CanSkip

		public override bool CanSkip(ObjectReference @ref)
		{
			ClassMetadata clazz = @ref.ClassMetadata();
			return clazz.Reflector().ForClass(typeof(IActivatable)).IsAssignableFrom(clazz.ClassReflector
				()) && !_query.IsModified(@ref.GetObject());
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:6,代码来源:TPFixedUpdateDepth.cs

示例7: IsStruct

 private bool IsStruct(ObjectReference @ref)
 {
     return @ref.ClassMetadata().IsStruct();
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:LocalTransaction.cs

示例8: Delete4

		public sealed override bool Delete4(Transaction transaction, ObjectReference @ref
			, object obj, int cascade, bool userCall)
		{
			int id = @ref.GetID();
			StatefulBuffer reader = ReadStatefulBufferById(transaction, id);
			if (reader != null)
			{
				if (obj != null)
				{
					if ((!ShowInternalClasses()) && Const4.ClassInternal.IsAssignableFrom(obj.GetType
						()))
					{
						return false;
					}
				}
				reader.SetCascadeDeletes(cascade);
				transaction.IdSystem().NotifySlotDeleted(id, SlotChangeFactory.UserObjects);
				ClassMetadata classMetadata = @ref.ClassMetadata();
				classMetadata.Delete(reader, obj);
				return true;
			}
			return false;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:23,代码来源:LocalObjectContainer.cs


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