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


C# ObjectReference.GetID方法代码示例

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


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

示例1: RemoveReference

 public override void RemoveReference(ObjectReference @ref)
 {
     if (_newReferences.ReferenceForId(@ref.GetID()) != null)
     {
         _newReferences.RemoveReference(@ref);
         ReferenceCountChanged(-1);
     }
     if (_committedReferences.ReferenceForId(@ref.GetID()) != null)
     {
         _committedReferences.RemoveReference(@ref);
         ReferenceCountChanged(-1);
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:13,代码来源:MonitoringReferenceSystem.cs

示例2: FrozenObjectInfo

		private FrozenObjectInfo(ObjectReference @ref, VirtualAttributes virtualAttributes
			) : this(@ref == null ? null : @ref.GetObject(), @ref == null ? -1 : @ref.GetID(
			), virtualAttributes == null ? null : virtualAttributes.i_database, virtualAttributes
			 == null ? -1 : virtualAttributes.i_uuid, virtualAttributes == null ? 0 : virtualAttributes
			.i_version)
		{
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:7,代码来源:FrozenObjectInfo.cs

示例3: IdAdd

		private void IdAdd(ObjectReference @ref)
		{
			if (DTrace.enabled)
			{
				DTrace.IdTreeAdd.Log(@ref.GetID());
			}
			if (_idTree == null)
			{
				_idTree = @ref;
				return;
			}
			_idTree = _idTree.Id_add(@ref);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:13,代码来源:HashcodeReferenceSystem.cs

示例4: Delete4

		public sealed override bool Delete4(Transaction ta, ObjectReference yo, object obj
			, int a_cascade, bool userCall)
		{
			MsgD msg = Msg.Delete.GetWriterForInts(_transaction, new int[] { yo.GetID(), userCall
				 ? 1 : 0 });
			WriteBatchedMessage(msg);
			return true;
		}
开发者ID:Galigator,项目名称:db4o,代码行数:8,代码来源:ClientObjectContainer.cs

示例5: 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

示例6: Delete2

		public void Delete2(Transaction trans, ObjectReference @ref, object obj, int cascade
			, bool userCall)
		{
			// This check is performed twice, here and in delete3, intentionally.
			if (BreakDeleteForEnum(@ref, userCall))
			{
				return;
			}
			if (obj is Entry)
			{
				if (!FlagForDelete(@ref))
				{
					return;
				}
				Delete3(trans, @ref, obj, cascade, userCall);
				return;
			}
			trans.Delete(@ref, @ref.GetID(), cascade);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:19,代码来源:ObjectContainerBase.cs

示例7: Bind2

		public ObjectReference Bind2(Transaction trans, ObjectReference oldRef, object obj
			)
		{
			int id = oldRef.GetID();
			trans.RemoveReference(oldRef);
			ObjectReference newRef = new ObjectReference(ClassMetadataForObject(obj), id);
			newRef.SetObjectWeak(this, obj);
			newRef.SetStateDirty();
			trans.ReferenceSystem().AddExistingReference(newRef);
			return newRef;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:11,代码来源:ObjectContainerBase.cs

示例8: 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

示例9: ReadVirtualAttributes

 public virtual void ReadVirtualAttributes(Transaction trans, ObjectReference @ref
     , bool lastCommitted)
 {
     var id = @ref.GetID();
     var container = trans.Container();
     var buffer = container.ReadBufferById(trans, id, lastCommitted);
     var oh = new ObjectHeader(this, buffer);
     var context = new ObjectReferenceContext(trans, buffer, oh, @ref
         );
     Handlers4.FieldAwareTypeHandler(CorrectHandlerVersion(context)).ReadVirtualAttributes
         (context);
 }
开发者ID:masroore,项目名称:db4o,代码行数:12,代码来源:ClassMetadata.cs

示例10: RemoveReference

		public virtual void RemoveReference(ObjectReference @ref)
		{
			if (DTrace.enabled)
			{
				DTrace.ReferenceRemoved.Log(@ref.GetID());
			}
			if (_hashCodeTree != null)
			{
				_hashCodeTree = _hashCodeTree.Hc_remove(@ref);
			}
			if (_idTree != null)
			{
				_idTree = _idTree.Id_remove(@ref);
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:15,代码来源:HashcodeReferenceSystem.cs

示例11: 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

示例12: Marshall

 internal override void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer
     buffer, bool isMigrating, bool isNew)
 {
     var attr = @ref.VirtualAttributes();
     var container = trans.Container();
     var doAddIndexEntry = isNew && container.MaintainsIndices();
     var dbID = 0;
     var linkToDatabase = (attr != null && attr.i_database == null) ? true : !isMigrating;
     if (linkToDatabase)
     {
         var db = ((IInternalObjectContainer) container).Identity();
         if (db == null)
         {
             // can happen on early classes like Metaxxx, no problem
             attr = null;
         }
         else
         {
             if (attr.i_database == null)
             {
                 attr.i_database = db;
                 // TODO: Should be check for ! client instead of instanceof
                 if (container is LocalObjectContainer)
                 {
                     attr.i_uuid = container.GenerateTimeStampId();
                     doAddIndexEntry = true;
                 }
             }
             db = attr.i_database;
             if (db != null)
             {
                 dbID = db.GetID(trans);
             }
         }
     }
     else
     {
         if (attr != null)
         {
             dbID = attr.i_database.GetID(trans);
         }
     }
     buffer.WriteInt(dbID);
     if (attr == null)
     {
         buffer.WriteLong(0);
         return;
     }
     buffer.WriteLong(attr.i_uuid);
     if (doAddIndexEntry)
     {
         AddIndexEntry(trans, @ref.GetID(), attr.i_uuid);
     }
 }
开发者ID:masroore,项目名称:db4o,代码行数:54,代码来源:UUIDFieldMetadata.cs


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