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


C# Transaction.Context方法代码示例

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


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

示例1: SearchLeaf

		public virtual BTreeNodeSearchResult SearchLeaf(Transaction trans, object key, SearchTarget
			 target)
		{
			return SearchLeaf(trans, _keyHandler.PrepareComparison(trans.Context(), key), target
				);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:6,代码来源:BTree.cs

示例2: SearchRange

		public virtual IBTreeRange SearchRange(Transaction trans, object key)
		{
			KeyCantBeNull(key);
			return SearchRange(trans, KeyHandler().PrepareComparison(trans.Context(), key));
		}
开发者ID:erdincay,项目名称:db4o,代码行数:5,代码来源:BTree.cs

示例3: SearchPointer

		public virtual BTreePointer SearchPointer(Transaction trans, object key)
		{
			EnsureActive(trans);
			KeyCantBeNull(key);
			IPreparedComparison preparedComparison = KeyHandler().PrepareComparison(trans.Context
				(), key);
			BTreeNodeSearchResult start = SearchLeaf(trans, preparedComparison, SearchTarget.
				Lowest);
			BTreePointer bTreePointer = start.FirstValidPointer();
			if (bTreePointer == null)
			{
				ConvertCacheEvictedNodesToReadMode();
				return null;
			}
			object found = bTreePointer.Key();
			ConvertCacheEvictedNodesToReadMode();
			if (preparedComparison.CompareTo(found) == 0)
			{
				return bTreePointer;
			}
			return null;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:22,代码来源:BTree.cs

示例4: Add

		public virtual void Add(Transaction trans, object key)
		{
			KeyCantBeNull(key);
			IPreparedComparison preparedComparison = _keyHandler.PrepareComparison(trans.Context
				(), key);
			Add(trans, preparedComparison, key);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:7,代码来源:BTree.cs

示例5: Remove

		public virtual object Remove(Transaction trans, object key)
		{
			BTreePointer bTreePointer = SearchPointer(trans, key);
			if (bTreePointer == null)
			{
				return null;
			}
			object result = bTreePointer.Key();
			Enlist(trans);
			IPreparedComparison preparedComparison = KeyHandler().PrepareComparison(trans.Context
				(), key);
			BTreeNode node = bTreePointer.Node();
			node.Remove(trans, preparedComparison, key, bTreePointer.Index());
			ConvertCacheEvictedNodesToReadMode();
			return result;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:16,代码来源:BTree.cs

示例6: ReadThis

		public override void ReadThis(Transaction trans, ByteArrayBuffer reader)
		{
			ReadNodeHeader(reader);
			PrepareArrays();
			bool isInner = !_isLeaf;
			for (int i = 0; i < _count; i++)
			{
				_keys[i] = KeyHandler().ReadIndexEntry(trans.Context(), reader);
				if (isInner)
				{
					_children[i] = reader.ReadInt();
				}
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:14,代码来源:BTreeNode.cs

示例7: Key

		internal object Key(Transaction trans, ByteArrayBuffer reader, int index)
		{
			if (CanWrite())
			{
				return InternalKey(trans, index);
			}
			if (reader == null)
			{
				reader = PrepareRead(trans);
			}
			if (CanWrite())
			{
				return InternalKey(trans, index);
			}
			SeekKey(reader, index);
			return KeyHandler().ReadIndexEntry(trans.Context(), reader);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:17,代码来源:BTreeNode.cs

示例8: CompareInReadMode

		private int CompareInReadMode(Transaction trans, IPreparedComparison preparedComparison
			, ByteArrayBuffer reader, int index)
		{
			SeekKey(reader, index);
			return -preparedComparison.CompareTo(KeyHandler().ReadIndexEntry(trans.Context(), 
				reader));
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:BTreeNode.cs

示例9: WriteThis

		public override void WriteThis(Transaction trans, ByteArrayBuffer buffer)
		{
			int count = 0;
			int startOffset = buffer._offset;
			IContext context = trans.Context();
			buffer.IncrementOffset(CountLeafAnd3LinkLength);
			if (_isLeaf)
			{
				for (int i = 0; i < _count; i++)
				{
					object obj = InternalKey(trans, i);
					if (obj != No4.Instance)
					{
						count++;
						KeyHandler().WriteIndexEntry(context, buffer, obj);
					}
				}
			}
			else
			{
				for (int i = 0; i < _count; i++)
				{
					if (ChildCanSupplyFirstKey(i))
					{
						Db4objects.Db4o.Internal.Btree.BTreeNode child = (Db4objects.Db4o.Internal.Btree.BTreeNode
							)_children[i];
						object childKey = child.FirstKey(trans);
						if (childKey != No4.Instance)
						{
							count++;
							KeyHandler().WriteIndexEntry(context, buffer, childKey);
							buffer.WriteIDOf(trans, child);
						}
					}
					else
					{
						count++;
						KeyHandler().WriteIndexEntry(context, buffer, Key(i));
						buffer.WriteIDOf(trans, _children[i]);
					}
				}
			}
			int endOffset = buffer._offset;
			buffer._offset = startOffset;
			buffer.WriteInt(count);
			buffer.WriteByte(_isLeaf ? (byte)1 : (byte)0);
			buffer.WriteInt(_parentID);
			buffer.WriteInt(_previousID);
			buffer.WriteInt(_nextID);
			buffer._offset = endOffset;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:51,代码来源:BTreeNode.cs

示例10: TraverseValues

		public void TraverseValues(Transaction transaction, IVisitor4 userVisitor)
		{
			if (!Alive())
			{
				return;
			}
			AssertHasIndex();
			ObjectContainerBase stream = transaction.Container();
			if (stream.IsClient)
			{
				Exceptions4.ThrowRuntimeException(Db4objects.Db4o.Internal.Messages.ClientServerUnsupported
					);
			}
			lock (stream.Lock())
			{
				IContext context = transaction.Context();
				_index.TraverseKeys(transaction, new _IVisitor4_866(this, userVisitor, context));
			}
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:19,代码来源:FieldMetadata.cs


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