本文整理汇总了C#中IContext.Transaction方法的典型用法代码示例。如果您正苦于以下问题:C# IContext.Transaction方法的具体用法?C# IContext.Transaction怎么用?C# IContext.Transaction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContext
的用法示例。
在下文中一共展示了IContext.Transaction方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreparedArrayContainsComparison
public PreparedArrayContainsComparison(IContext context, ArrayHandler arrayHandler
, ITypeHandler4 typeHandler, object obj)
{
_arrayHandler = arrayHandler;
_preparedComparison = Handlers4.PrepareComparisonFor(typeHandler, context, obj);
_container = context.Transaction().Container();
}
示例2: IndexEntryToObject
public object IndexEntryToObject(IContext context, object indexEntry)
{
if (indexEntry is Slot)
{
var slot = (Slot) indexEntry;
indexEntry = context.Transaction().Container().DecryptedBufferByAddress(slot.Address
(), slot.Length());
}
return ReadStringNoDebug(context, (IReadBuffer) indexEntry);
}
示例3: Val
internal virtual ByteArrayBuffer Val(object obj, IContext context)
{
if (obj is ByteArrayBuffer)
{
return (ByteArrayBuffer) obj;
}
var oc = context.Transaction().Container();
if (obj is string)
{
return WriteToBuffer(oc, (string) obj);
}
if (obj is Slot)
{
var s = (Slot) obj;
return oc.DecryptedBufferByAddress(s.Address(), s.Length());
}
return null;
}
示例4: OpenTypeHandlerFrom
private static ITypeHandler4 OpenTypeHandlerFrom(IContext context)
{
return context.Transaction().Container().Handlers.OpenTypeHandler();
}
示例5: SystemTransaction
private static LocalTransaction SystemTransaction(IContext context)
{
return (LocalTransaction) context.Transaction().SystemTransaction();
}
示例6: Container
internal virtual ObjectContainerBase Container(IContext context)
{
return context.Transaction().Container();
}
示例7: IndexEntryToObject
public object IndexEntryToObject(IContext context, object indexEntry)
{
if (indexEntry == null)
{
return null;
}
var id = ((int) indexEntry);
return ((ObjectContainerBase) context.ObjectContainer()).GetByID2(context.Transaction
(), id);
}
示例8: AddReference
private void AddReference(IContext context, object obj, int id)
{
Transaction transaction = context.Transaction();
ObjectReference @ref = new _ObjectReference_74(id);
@ref.ClassMetadata(transaction.Container().ClassMetadataForID(Handlers4.UntypedId
));
@ref.SetObjectWeak(transaction.Container(), obj);
transaction.AddNewReference(@ref);
}