TryGet() public static method

public static TryGet ( MethodBase method, RubyMethodDebugInfo &info ) : bool
method System.Reflection.MethodBase
info RubyMethodDebugInfo
return bool
        private bool TryGetStackFrameInfo(StackFrame /*!*/ frame, out string /*!*/ methodName, out string /*!*/ fileName, out int line)
        {
            MethodBase method = frame.GetMethod();

            methodName = method.Name;

            fileName = (_hasFileAccessPermission) ? GetFileName(frame) : null;
            var sourceLine = line = PlatformAdaptationLayer.IsCompactFramework ? 0 : frame.GetFileLineNumber();

            if (TryParseRubyMethodName(ref methodName, ref fileName, ref line))
            {
                if (sourceLine == 0)
                {
                    RubyMethodDebugInfo debugInfo;
                    if (RubyMethodDebugInfo.TryGet(method, out debugInfo))
                    {
                        var ilOffset = frame.GetILOffset();
                        if (ilOffset >= 0)
                        {
                            var mappedLine = debugInfo.Map(ilOffset);
                            if (mappedLine != 0)
                            {
                                line = mappedLine;
                            }
                        }
                    }
                }

                return(true);
            }
            else if (method.IsDefined(typeof(RubyStackTraceHiddenAttribute), false))
            {
                return(false);
            }
            else
            {
                object[] attrs = method.GetCustomAttributes(typeof(RubyMethodAttribute), false);
                if (attrs.Length > 0)
                {
                    // Ruby library method:
                    // TODO: aliases
                    methodName = ((RubyMethodAttribute)attrs[0]).Name;

                    if (!_exceptionDetail)
                    {
                        fileName = null;
                        line     = NextFrameLine;
                    }

                    return(true);
                }
                else if (_exceptionDetail || IsVisibleClrFrame(method))
                {
                    // Visible CLR method:
                    if (String.IsNullOrEmpty(fileName))
                    {
                        if (method.DeclaringType != null)
                        {
                            fileName = (_hasFileAccessPermission) ? GetAssemblyName(method.DeclaringType.Assembly) : null;
                            line     = 0;
                        }
                    }
                    return(true);
                }
                else
                {
                    // Invisible CLR method:
                    return(false);
                }
            }
        }