public UnionScheme(string tableName, string tableDesc, string nameField, IEnumerable <ITableSchemeEx> schemes) { TkDebug.AssertArgumentNullOrEmpty(tableName, "tableName", null); TkDebug.AssertArgumentNullOrEmpty(tableDesc, "tableDesc", null); TkDebug.AssertArgumentNull(schemes, "schemes", null); TableName = tableName; TableDesc = tableDesc; fFields = new RegNameList <UnionFieldInfoEx>(); foreach (var scheme in schemes) { foreach (var field in scheme.Fields) { if (!fFields.ConstainsKey(field.NickName)) { if (field is UnionFieldInfoEx) { fFields.Add((UnionFieldInfoEx)field); } else { fFields.Add(new UnionFieldInfoEx(field, null)); } } } } if (string.IsNullOrEmpty(nameField)) { NameField = schemes.FirstOrDefault()?.NameField; } else { NameField = fFields[nameField]; } }
private static bool IsShow(IFieldInfoEx field, PageStyle pageStyle, RegNameList <OverrideFieldConfig> overrideFields) { bool result = (field.Control.DefaultShow & pageStyle) == pageStyle; if (!result) { if (overrideFields != null) { result = overrideFields.ConstainsKey(field.NickName); } } return(result); }