Пример #1
0
 public static void SetupSearchableField(ISearchableField field, FieldResult fieldResult)
 {
     field.SearchConfiguration = ParseSearchFieldConfiguration(fieldResult.FilterData);
     field.FilterCommand       = fieldResult.FilterCommand;
     field.FilterData          = fieldResult.FilterData;
     field.FilterType          = fieldResult.FilterType ?? 0;
 }
Пример #2
0
        public static LookupPropertyField ToLookupPropertyField(this FieldResult fieldResult)
        {
            var field = fieldResult.ToGenericPropertyField <LookupPropertyField>();

            SetupSearchableField(field, fieldResult);

            return(field);
        }
Пример #3
0
        public static SearchField ToSearchField(this FieldResult fieldResult)
        {
            var field = fieldResult.ToField <SearchField>();

            SetupSearchableField(field, fieldResult);

            return(field);
        }
Пример #4
0
        public static GridField ToGridField(this FieldResult fieldResult)
        {
            var field = fieldResult.ToField <GridField>();

            field.Order = fieldResult.ResultOrder ?? int.MaxValue;

            return(field);
        }
Пример #5
0
        public static TPropertyField ToGenericPropertyField <TPropertyField>(this FieldResult fieldResult)
            where TPropertyField : PropertyField, new()
        {
            var field = fieldResult.ToField <TPropertyField>();

            field.IsEditable = field.IsEditable;
            field.Order      = fieldResult.ViewerOrder ?? fieldResult.ResultOrder ?? int.MaxValue;

            return(field);
        }
Пример #6
0
 public static TField ToField <TField>(this FieldResult fieldResult)
     where TField : Field, new()
 {
     return(new TField
     {
         Identifier = fieldResult.UniqueName ?? fieldResult.ID.ToString(),
         DisplayName = fieldResult.Name,
         Type = fieldResult.Type,
         IsKey = fieldResult.IsKey,
         MapTo = fieldResult.MapTo,
         Format = fieldResult.Format
     });
 }
Пример #7
0
 public static PropertyField ToPropertyField(this FieldResult fieldResult)
 {
     return(fieldResult.ToGenericPropertyField <PropertyField>());
 }