Exemplo n.º 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;
 }
Exemplo n.º 2
0
        public static LookupPropertyField ToLookupPropertyField(this FieldResult fieldResult)
        {
            var field = fieldResult.ToGenericPropertyField <LookupPropertyField>();

            SetupSearchableField(field, fieldResult);

            return(field);
        }
Exemplo n.º 3
0
        public static SearchField ToSearchField(this FieldResult fieldResult)
        {
            var field = fieldResult.ToField <SearchField>();

            SetupSearchableField(field, fieldResult);

            return(field);
        }
Exemplo n.º 4
0
        public static GridField ToGridField(this FieldResult fieldResult)
        {
            var field = fieldResult.ToField <GridField>();

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

            return(field);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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
     });
 }
Exemplo n.º 7
0
 public static PropertyField ToPropertyField(this FieldResult fieldResult)
 {
     return(fieldResult.ToGenericPropertyField <PropertyField>());
 }