public static bool Contains(this ResultDecorator decorator, Type type) { if (decorator.GetType() == type) { return(true); } return(decorator.NextDecorator != null && decorator.NextDecorator.Contains(type)); }
private void GetDecorated(List <Result> results) { if (results.Count > 2 && results[0].Value == results[1].Value && results[0].Value == results[2].Value && results[0].Id.StartsWith("r_0") && results[1].Id.StartsWith("r_0") && results[2].Id.StartsWith("r_0")) { AbstractResult result1 = new ResultDecorator(results[0]); result1.Decorate(); AbstractResult result2 = new ResultDecorator(results[1]); result2.Decorate(); AbstractResult result3 = new ResultDecorator(results[2]); result3.Decorate(); } }