Exemplo n.º 1
0
        public List <Option> GetArchetypePrevalues(LeBlenderValue leBlenderValue, string alias)
        {
            List <Option>  options = new List <Option>();
            ArchetypeModel archetypeModel;

            try
            {
                archetypeModel = leBlenderValue.GetValue <ArchetypeModel>(alias);
                if (archetypeModel != null)
                {
                    var query = archetypeModel.Fieldsets.Where(f => !f.Disabled).Select(f => new Option()
                    {
                        Name = f.GetValue("value")
                    });
                    if (query.Any())
                    {
                        options = query.ToList();
                    }
                }
                return(options);
            }
            catch (Exception)
            {
                return(options);
            }
        }
Exemplo n.º 2
0
 public string GetLeBlenderValueFieldValue(LeBlenderValue value, string alias)
 {
     if (value.HasProperty(alias))
     {
         return(value.GetRawValue(alias));
     }
     return(string.Empty);
 }
Exemplo n.º 3
0
        public Field LeBlenderValueAsField(string jsonValue)
        {
            Field          field          = new Field();
            LeBlenderValue leBlenderValue = JsonConvert.DeserializeObject <LeBlenderValue>(jsonValue);

            field.Name                   = GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.Name);
            field.Placeholder            = GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.Placeholder);
            field.Mandatory              = GetValueAsBoolean(GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.Mandatory));
            field.MessageMandatory       = GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.MessageMandatory);
            field.MessageInvalidFormat   = GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.MessageInvalidFormat);
            field.MessageOverMaxFileSize = GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.MessageOverMaxFileSize);
            field.Options                = GetArchetypePrevalues(leBlenderValue, PropertyAlias.Prevalues);
            field.SelectFileText         = GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.SelectFileText);
            field.ChangeFileText         = GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.ChangeFileText);
            field.MaxFileSize            = GetMaxRequestLength();
            field.MediaFolder            = PropertyValueAsMediaFolder(GetLeBlenderValueFieldValue(leBlenderValue, PropertyAlias.MediaFolder));
            return(field);
        }
Exemplo n.º 4
0
 public InfoBoxViewModel(LeBlenderValue x)
 {
     Heading  = x.GetValue <string>("heading");
     Content  = x.GetValue <IHtmlString>("rte");
     Position = x.GetValue <InfoBoxPosition>("factboxPosition");
 }
 protected GridControlLeBlenderValue(GridControl control, JToken token)
 {
     Control = control;
     JToken  = token;
     Value   = token.Value <LeBlenderValue>();
 }