예제 #1
0
        public void BuildString(PrintSettings settings, int level = 0)
        {
            string tabs = "";                           // new string(new sbyte()[], 0,0, Globals.ISO8859_1);
            string app  = new string(Globals.VPipe, 1); // new string(Globals.VPipe, 0,1, Globals.ISO8859_1);

            for (int i = 0; i < level; ++i)
            {
                string ap = "";
                if (Globals.Settings.ShowLongBranches)
                {
                    ap = app;
                }
                else
                {
                    ap = ((i == level - 1) ? app : "");
                }


                tabs += ap + new string(i == level - 1 ? Globals.HPipe : ' ', settings.TabSize);
            }

            foreach (FsItem item in Children)
            {
                if (item.FsItemState == FsItemState.None && settings.OmitUnchanged)
                {
                }
                else
                {
                    string str = tabs + item.ItemString();
                    settings.StringBuilder.Append(str);
                }

                item.BuildString(settings, level + 1);
            }
        }
예제 #2
0
 public string ToString(PrintSettings settings = null)
 {
     if (settings == null)
     {
         settings = new PrintSettings();
     }
     BuildString(settings, 0);
     return(settings.StringBuilder.ToString());
 }