IL.View.Controls.CodeView.Scope.AddChild C# (CSharp) Méthode

AddChild() public méthode

public AddChild ( Scope childScope ) : void
childScope Scope
Résultat void
    public void AddChild(Scope childScope)
    {
      if (childScope.Parent != null)
        throw new InvalidOperationException("The child scope already has a parent.");

      childScope.Parent = this;

      Children.Add(childScope);
    }
  }

Usage Example

Exemple #1
0
        private static void AddScopeToNestedScopes(Scope scope, ref Scope currentScope, ICollection <Scope> capturedStyleTree)
        {
            if (scope.Index >= currentScope.Index && (scope.Index + scope.Length <= currentScope.Index + currentScope.Length))
            {
                currentScope.AddChild(scope);
                currentScope = scope;
            }
            else
            {
                currentScope = currentScope.Parent;

                if (currentScope != null)
                {
                    AddScopeToNestedScopes(scope, ref currentScope, capturedStyleTree);
                }
                else
                {
                    capturedStyleTree.Add(scope);
                }
            }
        }
All Usage Examples Of IL.View.Controls.CodeView.Scope::AddChild