Example #1
0
 public void write(BmobOutput output, Boolean all)
 {
     foreach (var entry in this)
     {
         output.Put(entry.Key, entry.Value);
     }
 }
Example #2
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put("mobilePhoneNumber", mobilePhoneNumber);
            output.Put("template", template);
        }
Example #3
0
        /// <summary>
        /// 查询条件序列化对象
        ///
        /// 将请求封装为JSON发送到Bmob服务器中
        /// </summary>
        /// <param name="output"></param>
        /// <param name="all">是否输出所有的字段的值!请求的json是all为false。用于toString!</param>
        public override void write(BmobOutput output, Boolean all)
        {
            if (this.include != null)
            {
                output.Put("include", this.include);
            }
            if (this.count)
            {
                output.Put("count", this.count);
            }
            if (this.skip != 0)
            {
                output.Put("skip", this.skip);
            }
            if (this.limit != null)
            {
                output.Put("limit", this.limit);
            }

            if (keys != null && keys.Count > 0)
            {
                output.Put("keys", this.keys.join());
            }
            if (fOrderList.Count > 0)
            {
                output.Put("order", fOrderList.join());
            }
            if (_where != null && _where.Length() > 0)
            {
                output.Put("where", _where);
            }
        }
Example #4
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put(OP_NAME, "AddUnique");
            output.Put("objects", this.objects);
        }
Example #5
0
 public override void write(BmobOutput output, bool all)
 {
     base.write(output, all);
     output.Put(TYPE_NAME, this._type);
     output.Put("filename", this.filename);
     output.Put("group", this.group);
     output.Put("url", this.url);
 }
Example #6
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put(TYPE_NAME, this._type);
            output.Put("className", this.className);
            output.Put("objectId", refObjectId);
        }
Example #7
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put("name", this.name);
            output.Put("users", this.users);
            output.Put("roles", this.roles);
        }
Example #8
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put("where", Target.where);
            output.Put("data", Message);

            output.Put("expiration_time", ExpirationTime);

            output.Put("push_time", PushTime);
            output.Put("expiration_interval", ExpirationInterval);
        }
Example #9
0
        public override void write(BmobOutput output, Boolean all)
        {
            base.write(output, all);

            if (all)
            {
                output.Put("sessionToken", this.sessionToken);
            }

            output.Put("username", this.username);
            output.Put("password", this.password);
            output.Put("email", this.email);
        }
Example #10
0
        /// <summary>
        /// 实现 {column: {key: value}} 的效果
        /// </summary>
        internal static void Composite(IDictionary data, String column, String key, Object value)
        {
            var part = data[column];

            if (part == null || !(part is IDictionary))
            {
                // !!SimpleJson处理Dictionary<string, Object>才正常
                part = new Dictionary <String, Object>();
            }
            ((IDictionary)part).Add(key, value);

            BmobOutput.Save(data, column, part);
        }
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put("badge", this.badge);
            output.Put("channels", this.channels);
            output.Put("timeZone", this.timeZone);
            output.Put("deviceType", this.deviceType);

            output.Put("installationId", this.installationId);
            output.Put("deviceToken", this.deviceToken);
            output.Put("notificationUri", this.notificationUri);
            output.Put("deviceId", this.deviceId);
        }
Example #12
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            var enumerator = real.GetEnumerator();

            while (enumerator.MoveNext())
            {
                var key   = (string)enumerator.Key;
                var value = enumerator.Value;

                output.Put(key, value);
            }
        }
Example #13
0
        public override void write(BmobOutput output, Boolean all)
        {
            base.write(output, all);

            foreach (var entry in kvs)
            {
                var key = entry.Key;
                if (key == "objectId" || key == "createdAt" || key == "updatedAt")
                {
                    continue;
                }
                output.Put(key, entry.Value);
            }
        }
Example #14
0
        public override void write(BmobOutput output, Boolean all)
        {
            base.write(output, all);
            output.Put("ACL", this.ACL);

            foreach (String key in operates.Keys)
            {
                output.Put(key, (Operate)operates[key]);
            }

            if (all)
            {
                output.Put("objectId", this.objectId);
                output.Put("createdAt", this.createdAt);
                output.Put("updatedAt", this.updatedAt);
            }
        }
Example #15
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            var requests = new List <IDictionary>();

            foreach (BmobInteractObject req in BmobWrapper.Requests)
            {
                String method = req.Method;
                if (method == null)
                {
                    continue;
                }

                // XXX 1.6 根据restful接口优化
                String path = "";
                if (method.Equals("POST"))
                {
                    path = "/1/classes/" + req.Table;
                }
                else if (method.Equals("DELETE") || method.Equals("PUT"))
                {
                    path = "/1/classes/" + req.Table + "/" + req.ObjectId;
                }

                IDictionary one = new Dictionary <String, Object>();

                BmobOutput.Save(one, "method", method);
                if (BmobUser.CurrentUser != null)
                {
                    BmobOutput.Save(one, "token", BmobUser.CurrentUser.sessionToken);
                }
                BmobOutput.Save(one, "path", path);
                BmobOutput.Save(one, "body", req.Data);
                requests.Add(one);
            }

            output.Put("requests", requests);
        }
Example #16
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            if (Mode != null)
            {
                output.Put("mode", Mode);
            }
            if (Width != null)
            {
                output.Put("width", Width);
            }
            if (Height != null)
            {
                output.Put("height", Height);
            }
            if (LongEdge != null)
            {
                output.Put("longEdge", LongEdge);
            }
            if (ShortEdge != null)
            {
                output.Put("shortEdge", ShortEdge);
            }
            if (Quality != null)
            {
                output.Put("quality", Quality);
            }
            if (OutType != null)
            {
                output.Put("outType", OutType);
            }

            if (Image != null)
            {
                output.Put("image", Image);
            }
        }
Example #17
0
 public BmobACL WriteAccess(String objectId)
 {
     BmobOutput.Composite(acls, objectId, "write", true);
     return(this);
 }
Example #18
0
 internal Where Composite(String column, String type, Object value)
 {
     BmobOutput.Composite(real, column, type, value);
     return(this);
 }
Example #19
0
 public Where EqualTo(String column, object value)
 {
     BmobOutput.Save(real, column, value); return(this);
 }
Example #20
0
 public override void write(BmobOutput output, Boolean all)
 {
     output.Put("__op", this.op);
     output.Put("amount", this.amount);
 }
Example #21
0
 /// <summary>
 /// key是objectId(用户表某个用户对应的objectId)或者是 *(表示公共的访问权限),ACL 的值是 "读和写的权限", 这个JSON对象的key总是权限名, 而这些key的值总是 true
 /// </summary>
 public BmobACL ReadAccess(String key)
 {
     BmobOutput.Composite(acls, key, "read", true);
     return(this);
 }
Example #22
0
 public BmobACL WriteAccess(String key)
 {
     BmobOutput.Composite(acls, key, "write", true);
     return(this);
 }
Example #23
0
 internal IBmobOperator handle(String column, Operate op)
 {
     BmobOutput.Save(operates, column, op);
     return(this);
 }
 public override void write(BmobOutput output, Boolean all)
 {
     output.Put(TYPE_NAME, this._type);
     output.Put("latitude", this.latitude);
     output.Put("longitude", this.longitude);
 }
Example #25
0
 public virtual void write(BmobOutput output, Boolean all)
 {
 }
Example #26
0
 public override void write(BmobOutput output, Boolean all)
 {
     output.Put(TYPE_NAME, this._type);
     output.Put("iso", this.iso);
 }
Example #27
0
 /// <summary>
 /// key是objectId(用户表某个用户对应的objectId)或者是 *(表示公共的访问权限),ACL 的值是 "读和写的权限", 这个JSON对象的key总是权限名, 而这些key的值总是 true
 /// </summary>
 public BmobACL ReadAccess(String objectId)
 {
     BmobOutput.Composite(acls, objectId, "read", true);
     return(this);
 }
Example #28
0
 public BmobACL RoleWriteAccess(String rolename)
 {
     BmobOutput.Composite(acls, "role:" + rolename, "write", true);
     return(this);
 }