Mono.Cecil.Pdb.PdbReader.AddScope C# (CSharp) Method

AddScope() static private method

static private AddScope ( Collection scopes, ScopeDebugInformation scope ) : bool
scopes Collection
scope Mono.Cecil.Cil.ScopeDebugInformation
return bool
        static bool AddScope(Collection<ScopeDebugInformation> scopes, ScopeDebugInformation scope)
        {
            foreach (var sub_scope in scopes) {
                if (sub_scope.HasScopes && AddScope (sub_scope.Scopes, scope))
                    return true;

                if (scope.Start.Offset >= sub_scope.Start.Offset && scope.End.Offset <= sub_scope.End.Offset) {
                    sub_scope.Scopes.Add (scope);
                    return true;
                }
            }

            return false;
        }