コード例 #1
0
ファイル: EntityField.cs プロジェクト: 569550384/Rafy
 protected override void ToJson(LiteJsonWriter json)
 {
     json.WriteProperty("name", name);
     if (!persist) json.WriteProperty("persist", persist);
     json.WritePropertyIf("defaultValue", defaultValue);
     json.WriteProperty("type", ServerTypeHelper.GetClientFieldTypeName(type));
 }
コード例 #2
0
        protected override void ToJson(LiteJsonWriter json)
        {
            json.WriteProperty("type", "belongsTo");
            json.WritePropertyIf("foreignKey", foreignKey);
            json.WriteProperty("primaryKey", "Id");
            json.WritePropertyIf("associationKey", associationKey);

            base.ToJson(json);
        }
コード例 #3
0
ファイル: EntityJson.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            if (children.Count > 0) { json.WriteProperty("entities", children); }
            else { json.WriteProperty("leaf", true); }

            //if (expanded) json.WriteProperty("expanded", expanded);

            if (!this.HasDynamicProperty) { this.SetProperty("e", "1"); }

            base.ToJson(json);
        }
コード例 #4
0
ファイル: HasManyAssociation.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            json.WriteProperty("type", "hasMany");
            json.WritePropertyIf("name", name);
            json.WriteProperty("primaryKey", "Id");
            json.WritePropertyIf("foreignKey", foreignKey);

            if (autoLoad) { json.WriteProperty("autoLoad", true); }

            base.ToJson(json);
        }
コード例 #5
0
ファイル: GridColumnConfig.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            json.WriteProperty("header", header);
            json.WritePropertyIf("xtype", xtype);
            json.WritePropertyIf("editor", editor);
            if (locked) { json.WritePropertyIf("locked", locked); }

            if (flex > 0)
            {
                json.WriteProperty("flex", flex);
            }
            json.WriteProperty("dataIndex", dataIndex);
        }
コード例 #6
0
ファイル: EntityModel.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            if (isTree)
            {
                json.WritePropertyIf("isTree", isTree);
            }

            json.WriteProperty("fields", fields);

            if (associations.Count > 0)
            {
                json.WriteProperty("associations", associations);
            }
        }
コード例 #7
0
ファイル: JsonModel.cs プロジェクト: 569550384/Rafy
 /// <summary>
 /// Writes all properties by reflection.
 /// </summary>
 /// <param name="json">The json writer.</param>
 protected void WriteAllProperties(LiteJsonWriter json)
 {
     var properties = this.GetType().GetProperties();
     for (int i = 0, c = properties.Length; i < c; i++)
     {
         var property = properties[i];
         var value = property.GetValue(this, null);
         if (value is IEnumerable<JsonModel>)
         {
             json.WriteProperty(property.Name, value as IEnumerable<JsonModel>);
         }
         else
         {
             json.WriteProperty(property.Name, value);
         }
     }
 }
コード例 #8
0
        /// <summary>
        /// Writes all properties by reflection.
        /// </summary>
        /// <param name="json">The json writer.</param>
        protected void WriteAllProperties(LiteJsonWriter json)
        {
            var properties = this.GetType().GetProperties();

            for (int i = 0, c = properties.Length; i < c; i++)
            {
                var property = properties[i];
                var value    = property.GetValue(this, null);
                if (value is IEnumerable <JsonModel> )
                {
                    json.WriteProperty(property.Name, value as IEnumerable <JsonModel>);
                }
                else
                {
                    json.WriteProperty(property.Name, value);
                }
            }
        }
コード例 #9
0
ファイル: DynamicJsonModel.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            int i = 0, c = this._properties.Count;

            foreach (var kv in this._properties)
            {
                json.WriteProperty(kv.Key, kv.Value);
                i++;
            }
        }
コード例 #10
0
ファイル: DynamicJsonModel.cs プロジェクト: yungtau/oea
        protected override void ToJson(LiteJsonWriter json)
        {
            int i = 0, c = this._properties.Count;

            foreach (var kv in this._properties)
            {
                json.WriteProperty(kv.Key, kv.Value);
                i++;
            }
        }
コード例 #11
0
ファイル: FieldConfig.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            json.WritePropertyIf("name", name);
            json.WritePropertyIf("anchor", anchor);
            json.WritePropertyIf("fieldLabel", fieldLabel);
            json.WritePropertyIf("visibilityIndicator", visibilityIndicator);
            if (isReadonly) { json.WriteProperty("readOnly", isReadonly); }

            this.SetProperty("xtype", xtype);
            base.ToJson(json);
        }
コード例 #12
0
ファイル: TextFieldConfig.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            if (allowBlank) { json.WriteProperty("allowBlank", allowBlank); }

            base.ToJson(json);
        }
コード例 #13
0
ファイル: ClientAggtMeta.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            if (mainBlock == null) throw new ArgumentNullException("mainBlock");

            json.WritePropertyIf("layoutClass", layoutClass);
            json.WritePropertyIf("childProperty", childProperty);
            json.WriteProperty("mainBlock", mainBlock);
            json.WritePropertyIf("children", children);
            json.WritePropertyIf("surrounders", surrounders);
        }
コード例 #14
0
ファイル: GridConfig.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            if (tbar.Count > 0) { json.WriteProperty("tbar", tbar); }

            json.WriteProperty("columns", columns);
        }
コード例 #15
0
ファイル: EntityAssociation.cs プロジェクト: 569550384/Rafy
 protected override void ToJson(LiteJsonWriter json)
 {
     json.WriteProperty("model", model);
 }
コード例 #16
0
ファイル: ClientResult.cs プロジェクト: 569550384/Rafy
 protected override void ToJson(LiteJsonWriter json)
 {
     json.WriteProperty(SuccessProperty, Success.Box());
     json.WritePropertyIf(MessageProperty, Message);
 }
コード例 #17
0
ファイル: StoreConfig.cs プロジェクト: 569550384/Rafy
 protected override void ToJson(LiteJsonWriter json)
 {
     json.WriteProperty("pageSize", pageSize);
 }
コード例 #18
0
ファイル: EnumFieldConfig.cs プロジェクト: 569550384/Rafy
 protected override void ToJson(LiteJsonWriter json)
 {
     json.WriteProperty("text", text);
     json.WriteProperty("value", value);
 }
コード例 #19
0
ファイル: EntityJsonList.cs プロジェクト: 569550384/Rafy
        protected override void ToJson(LiteJsonWriter json)
        {
            json.WriteProperty("text", ".");

            base.ToJson(json);
        }
コード例 #20
0
ファイル: EntityJsonList.cs プロジェクト: 569550384/Rafy
 protected override void ToJson(LiteJsonWriter json)
 {
     json.WriteProperty("model", ClientEntities.GetClientName(model));
     json.WriteProperty("total", total);
     json.WriteProperty("entities", entities);
 }