public override void Check() { Woker woker = new Woker(); this.Accept(woker); if (components.Count == woker.components.Count) { return; } foreach (var component in woker.components) // list totalls { var searchComponent = components.FirstOrDefault(s => s.Equals(component)); // Equals if (searchComponent == null) { this.Add(component); component.childNode = new TreeNode(component.SetTextNode()); this.childNode.Nodes.Add(component.childNode); this.childNode.BackColor = System.Drawing.Color.Pink; component.childNode.BackColor = System.Drawing.Color.Pink; woker.PlaceBet(component); //this.childNode.Expand(); } } }
public override void Interpret(List <CurrentOrderSummary> currentOrders) // will call for type Composite (CountryPatern and EventPatern) { string textNode = SetTextNode(); this.childNode = new TreeNode(textNode); Woker woker = new Woker(currentOrders); this.Accept(woker); foreach (var component in woker.components) { this.Add(component); component.Interpret(currentOrders); } }