Microsoft.Scripting.Interpreter.InterpretedFrame.IsInterpretedFrame C# (CSharp) Méthode

IsInterpretedFrame() public static méthode

public static IsInterpretedFrame ( MethodBase method ) : bool
method System.Reflection.MethodBase
Résultat bool
        public static bool IsInterpretedFrame(MethodBase method) {
            ContractUtils.RequiresNotNull(method, "method");
            return method.DeclaringType == typeof(Interpreter) && method.Name == "Run";
        }

Usage Example

Exemple #1
0
        /// <summary>
        /// A single interpreted frame might be represented by multiple subsequent Interpreter.Run CLR frames.
        /// This method filters out the duplicate CLR frames.
        /// </summary>
        public static IEnumerable <StackFrame> GroupStackFrames(IEnumerable <StackFrame> stackTrace)
        {
            bool inInterpretedFrame = false;

            foreach (StackFrame frame in stackTrace)
            {
                MethodBase method = frame.GetMethod();

                // mono sets the method to null for dynamic methods
                // IsInterpretedFrame doesn't allow null methods
                if (method == null)
                {
                    continue;
                }

                if (InterpretedFrame.IsInterpretedFrame(method))
                {
                    if (inInterpretedFrame)
                    {
                        continue;
                    }
                    inInterpretedFrame = true;
                }
                else
                {
                    inInterpretedFrame = false;
                }
                yield return(frame);
            }
        }
All Usage Examples Of Microsoft.Scripting.Interpreter.InterpretedFrame::IsInterpretedFrame