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


C# QueryingReadContext.Transaction方法代码示例

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


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

示例1: ReadCandidateHandler

		public override ITypeHandler4 ReadCandidateHandler(QueryingReadContext context)
		{
			int id = 0;
			int offset = context.Offset();
			try
			{
				id = context.ReadInt();
			}
			catch (Exception)
			{
			}
			context.Seek(offset);
			if (id != 0)
			{
				StatefulBuffer reader = context.Container().ReadStatefulBufferById(context.Transaction
					(), id);
				if (reader != null)
				{
					ObjectHeader oh = new ObjectHeader(context.Container(), reader);
					try
					{
						if (oh.ClassMetadata() != null)
						{
							context.Buffer(reader);
							return oh.ClassMetadata().SeekCandidateHandler(context);
						}
					}
					catch (Exception e)
					{
					}
				}
			}
			// TODO: Check Exception Types
			// Errors typically occur, if classes don't match
			return null;
		}
开发者ID:Galigator,项目名称:db4o,代码行数:36,代码来源:OpenTypeHandler0.cs

示例2: CollectIDs

		//    	throw new IllegalStateException();
		public virtual void CollectIDs(QueryingReadContext readContext)
		{
			IInternalReadContext context = (IInternalReadContext)readContext;
			int payloadOffset = context.ReadInt();
			if (payloadOffset == 0)
			{
				return;
			}
			int savedOffSet = context.Offset();
			try
			{
				ITypeHandler4 typeHandler = ReadTypeHandler(context, payloadOffset);
				if (typeHandler == null)
				{
					return;
				}
				SeekSecondaryOffset(context, typeHandler);
				if (IsPlainObject(typeHandler))
				{
					readContext.Collector().AddId(readContext.ReadInt());
					return;
				}
				CollectIdContext collectIdContext = new _CollectIdContext_203(readContext, readContext
					.Transaction(), readContext.Collector(), null, readContext.Buffer());
				Handlers4.CollectIdsInternal(collectIdContext, context.Container().Handlers.CorrectHandlerVersion
					(typeHandler, context.HandlerVersion()), 0, false);
			}
			finally
			{
				context.Seek(savedOffSet);
			}
		}
开发者ID:Galigator,项目名称:db4o,代码行数:33,代码来源:OpenTypeHandler.cs

示例3: ReadSubCandidate

		public QCandidate ReadSubCandidate(QueryingReadContext context, ITypeHandler4 handler
			)
		{
			ObjectID objectID = ObjectID.NotPossible;
			try
			{
				int offset = context.Offset();
				if (handler is IReadsObjectIds)
				{
					objectID = ((IReadsObjectIds)handler).ReadObjectID(context);
				}
				if (objectID.IsValid())
				{
					return new QCandidate(this, null, objectID._id);
				}
				if (objectID == ObjectID.NotPossible)
				{
					context.Seek(offset);
					object obj = context.Read(handler);
					if (obj != null)
					{
						QCandidate candidate = new QCandidate(this, obj, context.Container().GetID(context
							.Transaction(), obj));
						candidate.ClassMetadata(context.Container().ClassMetadataForObject(obj));
						return candidate;
					}
				}
			}
			catch (Exception)
			{
			}
			// FIXME: Catchall
			return null;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:34,代码来源:QCandidates.cs

示例4: CollectIDsByInstantiatingCollection

 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 private void CollectIDsByInstantiatingCollection(QueryingReadContext context)
 {
     var id = context.CollectionID();
     if (id == 0)
     {
         return;
     }
     var transaction = context.Transaction();
     var container = context.Container();
     var obj = container.GetByID(transaction, id);
     if (obj == null)
     {
         return;
     }
     // FIXME: [TA] review activation depth
     var depth = DepthUtil.AdjustDepthToBorders(2);
     container.Activate(transaction, obj, container.ActivationDepthProvider().ActivationDepth
         (depth, ActivationMode.Activate));
     Platform4.ForEachCollectionElement(obj, new _IVisitor4_390(context));
 }
开发者ID:masroore,项目名称:db4o,代码行数:21,代码来源:StandardReferenceTypeHandler.cs

示例5: CollectIDsByTypehandlerAspect

 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 private bool CollectIDsByTypehandlerAspect(QueryingReadContext context)
 {
     var aspectFound = new BooleanByRef(false);
     var subContext = CollectIdContext.ForID(context.Transaction(), context
         .Collector(), context.CollectionID());
     ITraverseAspectCommand command = new _MarshallingInfoTraverseAspectCommand_349(this
         , aspectFound, subContext, EnsureFieldList(subContext));
     TraverseAllAspects(subContext, command);
     return aspectFound.value;
 }
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:StandardReferenceTypeHandler.cs

示例6: CollectIDs

		// TODO Auto-generated method stub
		public virtual void CollectIDs(QueryingReadContext context)
		{
			int id = context.ReadInt();
			BTree bTree = NewBTree(context, id);
			bTree.TraverseKeys(context.Transaction(), new _IVisitor4_83(context));
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:BigSetTypeHandler.cs


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