public TIAOpennessConstant FindConstant(string name) { foreach (var t in TagTables) { var c = t.Constants.FirstOrDefault(x => x.Name == name); if (c != null) { return(c); } } foreach (var f in SubItems.Flatten(x => x.SubItems)) { foreach (var t in TagTables) { var c = t.Constants.FirstOrDefault(x => x.Name == name); if (c != null) { return(c); } } } return(null); }