Exemple #1
0
 public void AddViewFielLov(ViewFieldLov lov)
 {
     this.lov = lov;
     this.lov.ParentSerializableEntity = this;
 }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            if (reader.TokenType == JsonToken.Null)
            {
                return(null);
            }

            JObject   jObject = JObject.Load(reader);
            ViewField target  = default(ViewField);

            if (jObject != null)
            {
                target = Create(objectType);
                target.AllowAdvancedSearch = jObject["AllowAdvancedSearch"].Value <bool>();
                target.AllowEdit           = jObject["AllowEdit"].Value <bool>();
                target.AllowMassiveUpdate  = jObject["AllowMassiveUpdate"].Value <bool>();
                target.AllowMultiEdit      = jObject["AllowMultiEdit"].Value <bool>();
                target.AllowSearch         = jObject["AllowSearch"].Value <bool>();
                target.ColSpan             = jObject["ColSpan"].Value <int>();
                target.DefaultValueCode    = jObject["DefaultValueCode"].Value <string>();

                if (jObject["DrillDownLink"].HasValues)
                {
                    Link obj = jObject["DrillDownLink"].ToObject <Link>(serializer);
                    if (obj != null)
                    {
                        target.AddDrillDownLink(obj);
                    }
                }

                target.EditableCondition   = jObject["EditableCondition"].Value <string>();
                target.ImageFalseMode      = (ViewFieldImageMode)Enum.Parse(typeof(ViewFieldImageMode), jObject["ImageFalseMode"].Value <string>());
                target.ImageNameFalse      = jObject["ImageNameFalse"].Value <string>();
                target.ImageNameTrue       = jObject["ImageNameTrue"].Value <string>();
                target.ImageTrueMode       = (ViewFieldImageMode)Enum.Parse(typeof(ViewFieldImageMode), jObject["ImageTrueMode"].Value <string>());
                target.IsRequired          = jObject["IsRequired"].Value <bool>();
                target.IsVisible           = jObject["IsVisible"].Value <bool>();
                target.IsVisibleOnCreation = jObject["IsVisibleOnCreation"].Value <bool>();

                if (jObject["Lov"].HasValues)
                {
                    ViewFieldLov obj = jObject["Lov"].ToObject <ViewFieldLov>(serializer);
                    if (obj != null)
                    {
                        target.AddViewFielLov(obj);
                    }
                }

                target.Name = jObject["Name"].Value <string>();
                if (jObject["Property"].HasValues)
                {
                    target.Property = jObject["Property"]["$ref"].Value <string>();
                }

                target.ReEvaluateVisibilityOnChange = jObject["ReEvaluateVisibilityOnChange"].Value <bool>();
                target.RequiredCondition            = jObject["RequiredCondition"].Value <string>();
                target.RowSpan             = jObject["RowSpan"].Value <int>();
                target.SearchResource      = jObject["SearchResource"].Value <bool>();
                target.Sequence            = jObject["Sequence"].Value <int>();
                target.ShowInCollapsedGrid = jObject["ShowInCollapsedGrid"].Value <bool>();
                target.ShowInExpandedGrid  = jObject["ShowInExpandedGrid"].Value <bool>();
                if (jObject["Title"].HasValues)
                {
                    target.Title = jObject["Title"]["$ref"].Value <string>();
                }
                if (jObject["Tooltip"].HasValues)
                {
                    target.Tooltip = jObject["Tooltip"]["$ref"].Value <string>();
                }
                target.UseValueExpressionCode = jObject["UseValueExpressionCode"].Value <bool>();
                if (jObject["Validator"].HasValues)
                {
                    target.Tooltip = jObject["Validator"]["$ref"].Value <string>();
                }
                target.ValidatorCode = jObject["ValidatorCode"].Value <string>();
                if (jObject["ValidatorText"].HasValues)
                {
                    target.Tooltip = jObject["ValidatorText"]["$ref"].Value <string>();
                }
                target.ValueExpressionCode = jObject["ValueExpressionCode"].Value <string>();
                if (jObject["ViewAdvancedSearch"].HasValues)
                {
                    target.Tooltip = jObject["ViewAdvancedSearch"]["$ref"].Value <string>();
                }
                target.ViewAdvancedSearchCode = jObject["ViewAdvancedSearchCode"].Value <string>();
                target.ViewFieldType          = (ViewFieldType)Enum.Parse(typeof(ViewFieldType), jObject["ViewFieldType"].Value <string>());
                target.VisibilityCondition    = jObject["VisibilityCondition"].Value <string>();
            }
            return(target);
        }
Exemple #3
0
 public void CreateViewFielLov()
 {
     this.lov = new ViewFieldLov();
     this.lov.ParentSerializableEntity = this;
 }