Google.Api.Ads.AdWords.Examples.CSharp.v201306.GetAccountHierarchy.ManagedCustomerTreeNode.ToTreeString C# (CSharp) Method

ToTreeString() public method

Returns a string representation of the current level of the tree and recursively returns the string representation of the levels below it.
public ToTreeString ( int depth, StringBuilder sb ) : StringBuilder
depth int The depth of the node.
sb StringBuilder The String Builder containing the tree /// representation.
return StringBuilder
            public StringBuilder ToTreeString(int depth, StringBuilder sb)
            {
                sb.Append(new String('-', depth * 2));
                sb.Append(this);
                sb.Append("\n");
                foreach (ManagedCustomerTreeNode childAccount in childAccounts) {
                  childAccount.ToTreeString(depth + 1, sb);
                }
                return sb;
            }
GetAccountHierarchy.ManagedCustomerTreeNode