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


C# OrderedDictionary.KeyForIndex方法代码示例

本文整理汇总了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));
开发者ID:chkn,项目名称:cirrus,代码行数:67,代码来源:TargetIL_old.cs


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