Exemplo n.º 1
0
        public static FieldInfo GetFieldInfo(int id)
        {
            var entries = FieldManagerCache.GetAllTableStyles();

            var entry = entries.FirstOrDefault(x => x.Value != null && x.Value.Id == id);

            return(entry.IsDefault() ? null : entry.Value);
        }
Exemplo n.º 2
0
        public static List <FieldInfo> GetFieldInfoList(int formId)
        {
            var fieldInfoList = new List <FieldInfo>();

            var entries  = FieldManagerCache.GetAllTableStyles();
            var startKey = GetKeyPrefix(formId);
            var list     = entries.Where(tuple => tuple.Key.StartsWith(startKey)).ToList();

            foreach (var pair in list)
            {
                if (pair.IsDefault())
                {
                    continue;
                }

                fieldInfoList.Add(pair.Value);
            }

            return(fieldInfoList.OrderBy(fieldInfo => fieldInfo.Taxis == 0 ? int.MaxValue : fieldInfo.Taxis).ToList());
        }