本文整理汇总了C#中ICodeBlock.Run方法的典型用法代码示例。如果您正苦于以下问题:C# ICodeBlock.Run方法的具体用法?C# ICodeBlock.Run怎么用?C# ICodeBlock.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICodeBlock
的用法示例。
在下文中一共展示了ICodeBlock.Run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetThrowable
private static Exception GetThrowable(ICodeBlock block)
{
try
{
block.Run();
}
catch (Exception e)
{
return e;
}
return null;
}
示例2: AssertAllSlotsFreed
/// <exception cref="System.Exception"></exception>
public static void AssertAllSlotsFreed(LocalTransaction trans, BTree bTree, ICodeBlock
block)
{
LocalObjectContainer container = (LocalObjectContainer)trans.Container();
ITransactionalIdSystem idSystem = trans.IdSystem();
IEnumerator allSlotIDs = bTree.AllNodeIds(trans.SystemTransaction());
Collection4 allSlots = new Collection4();
while (allSlotIDs.MoveNext())
{
int slotID = ((int)allSlotIDs.Current);
Slot slot = idSystem.CurrentSlot(slotID);
allSlots.Add(slot);
}
Slot bTreeSlot = idSystem.CurrentSlot(bTree.GetID());
allSlots.Add(bTreeSlot);
Collection4 freedSlots = new Collection4();
IFreespaceManager freespaceManager = container.FreespaceManager();
container.InstallDebugFreespaceManager(new FreespaceManagerForDebug(new _ISlotListener_99
(freedSlots)));
block.Run();
container.InstallDebugFreespaceManager(freespaceManager);
Assert.IsTrue(freedSlots.ContainsAll(allSlots.GetEnumerator()));
}