public DiscProgram GetRootDisc() { DiscProgram disc = _tower.First().Value; while (disc.Parent != null) { disc = disc.Parent; } return(disc); }
public void AddChild(DiscProgram newChild) { // Set the child's parent value. newChild.Parent = this; // Add this to the current node's children. this.Children.Add(newChild); // Recalculate the total weight. this.RecalculateTotalWeight(); }
public override bool Equals(object obj) { DiscProgram other = obj as DiscProgram; if (other == null) { return(false); } else { return(this.Name.Equals(other.Name)); } }
public void AddDisc(DiscProgram program) { _tower.Add(program.Name, program); }