本文整理汇总了C#中OrderedDictionary.KeyForIndex方法的典型用法代码示例。如果您正苦于以下问题:C# OrderedDictionary.KeyForIndex方法的具体用法?C# OrderedDictionary.KeyForIndex怎么用?C# OrderedDictionary.KeyForIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderedDictionary
的用法示例。
在下文中一共展示了OrderedDictionary.KeyForIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformAsyncMethod
//.........这里部分代码省略.........
current.Add (il.Create (OpCodes.Call, getException));
current.Add (il.Create (OpCodes.Brfalse, inst));
// houston, we have an exception..
//if (hasCatch) {
// OpCodes.Call, $catch1
// ...
// } else {
current.Add (il.Create (OpCodes.Ldarg_0));
current.Add (il.Create (OpCodes.Ldarg_0));
current.Add (il.Create (OpCodes.Ldfld, chainedFld));
current.Add (il.Create (OpCodes.Call, getException));
current.Add (il.Create (OpCodes.Call, setException));
// }
// if (hasFinally)
// OpCodes.Call, $finally1
// if (!hasCatch)
current.Add (il.Create (OpCodes.Ret));
current.Add (inst); // Nop
coroutineInstructions.Add (inst, current);
i = coroutineInstructions.IndexOfKey (continuationInst);
while (continuationInst != lastStack) {
// move these to after the continuation
// FIXME: Currently, we can't handle any jumps into this critical area
if (method.Body.IsJumpTarget (continuationInst))
throw new NotSupportedException ("Support for jumps into continuation critical area not implemented");
current = coroutineInstructions [i];
coroutineInstructions.RemoveAt (i);
coroutineInstructions.Add (continuationInst, current);
continuationInst = coroutineInstructions.KeyForIndex (++i);
}
// load the continuation result if there is one
var waitFutureType = callee.DeclaringType as GenericInstanceType;
if (waitFutureType != null) {
var getValueMethod = module.Import (typeof (Future<>).GetProperty ("Value").GetGetMethod (), waitFutureType);
getValueMethod.DeclaringType = waitFutureType;
current = new List<Instruction> ();
current.Add (il.Create (OpCodes.Ldarg_0));
current.Add (il.Create (OpCodes.Ldfld, chainedFld));
current.Add (il.Create (OpCodes.Call, getValueMethod));
coroutineInstructions.Add (instruction, current);
}
continue;
}
//5
if (callee.Name == "op_Implicit" && callee.DeclaringType.IsBuiltInFutureType ()
&& instruction.Next.OpCode == OpCodes.Ret)
continue;
//6
if (callee.Name == "Yield" && callee.DeclaringType.FullName == "Cirrus.Thread") {
var inst = il.Create (OpCodes.Ret);
continuations.Add (inst);
current.Add (il.Create (OpCodes.Ldarg_0));
current.Add (il.Create (OpCodes.Call, isScheduled));
current.Add (il.Create (OpCodes.Brtrue, inst));