internal InfoGroup Copy() { var g = new InfoGroup(Name, null); foreach (var i in this.groups) { g.groups.Add(i.Copy(g)); } foreach (var i in this.items) { g.items.Add(i.Copy()); } return(g); }
internal InfoGroup Copy(InfoGroup g) { var o = new InfoGroup(Name, g); foreach (var i in this.groups) { o.groups.Add(i.Copy(o)); } foreach (var i in items) { o.items.Add(i.Copy()); } return(o); }
/// <summary> /// Get path thought start of group to this item and item name. /// </summary> /// <returns><example>{group.name}/{group.name}/.../{item.name}</example></returns> public string GetGroupPath() { StringBuilder s = new StringBuilder(); InfoGroup acG = this.Up; while (acG != null) { s.Insert(0, acG.Name); s.Insert(0, '\\'); acG = acG.Up; } s.Remove(0, 1); s.Append('\\'); s.Append(Name); return(s.ToString()); }
public InfoGroup(string n, InfoGroup up) { Name = n; Up = up; }