Example #1
0
        //professor/contents/tree/add
        public Dictionary <string, object> _add(ActionExecutingContext c)
        {
            var j = bs.reqJson(c.HttpContext.Request); //{"r":3, "title":"트리 추가"}
            var k = bs.reqPath(c.HttpContext.Request); //professor/contents/tree/add

            if (!bs.S <bool>(k))
            {
                bs.S(k, true);
                bs.msg(k + "/r", (value, rule, arg, safe) => "정수값을 입력하세요.");
                bs.msg(k + "/title", (value, rule, arg, safe) => "문자열로 입력하세요.");
                bs.vali(k, "r", "int:" + k + "/r", "title", "string:" + k + "/title"); //contree_rowid, title
            }
            var result = bs.valiResult();

            if (!bs.vali(k).check(out result, bs.json2kv(j, "r", "title")))
            {
                bs.s("valiError", result);
                return(null);
            }
            else
            {
                return(new Dictionary <string, object>()
                {
                    { "contree_rowid", result["r"].value },
                    { "title", result["title"].value }
                });
            }
        }
Example #2
0
        public Dictionary <string, object> _add(ActionExecutingContext c)
        {
            var j = bs.reqJson(c.HttpContext.Request); //{"cmps_r":3, "username":"******"}
            var k = bs.reqPath(c.HttpContext.Request); //professor/add

            if (!bs.S <bool>(k))
            {
                bs.S(k, true);
                bs.msg(k + "/cmps_r", (value, rule, arg, safe) => "정수값을 입력하세요.");
                bs.msg(k + "/username", (value, rule, arg, safe) => "잘못된 형식의 이름입니다.");
                bs.vali(k, "cmps_r", "int:" + k + "/cmps_r", "username", "min[1]|max[10]");
            }
            var result = bs.valiResult();

            if (!bs.vali(k).check(out result, bs.json2kv(j, "cmps_r", "username")))
            {
                bs.s("valiError", result);
                return(null);
            }
            else
            {
                return(new Dictionary <string, object>()
                {
                    { "cmps_rowid", result["cmps_r"].value },
                    { "username", result["username"].value }
                });
            }
        }
Example #3
0
    static private GameObject go(object[] arg)
    {
        for (int i = 0; i < arg.Length;)
        {
            object key = arg[i++];
            if (key is G)
            {
                switch ((G)key)
                {
                case G.x: _goCurr.__go.SendMessage("x", arg[i++]); break;

                case G.y: _goCurr.__go.SendMessage("y", arg[i++]); break;

                case G.texture: _goCurr.__go.SendMessage("tex", _texture[(string)arg[i++]]); break;

                case G.uv: _goCurr.__go.SendMessage("uv", arg[i++]); break;

                case G.width: _goCurr.__go.SendMessage("w", arg[i++]); break;

                case G.height: _goCurr.__go.SendMessage("h", arg[i++]); break;

                case G.active: _goCurr.__go.SendMessage("active", arg[i++]); break;

                case G.pivot: _goCurr.__go.SendMessage("pivot", arg[i++]); break;
                //case G.grid: _goCurr.__go.SendMessage( "grid", arg[i++] ); break;

                case G.down0: _goCurr.__go.SendMessage("down0", arg[i++]); break;

                case G.down1: _goCurr.__go.SendMessage("down1", arg[i++]); break;

                case G.down2: _goCurr.__go.SendMessage("down2", arg[i++]); break;

                case G.up0: _goCurr.__go.SendMessage("up0", arg[i++]); break;

                case G.up1: _goCurr.__go.SendMessage("up1", arg[i++]); break;

                case G.up2: _goCurr.__go.SendMessage("up2", arg[i++]); break;

                case G.screen: _goCurr.__go.SendMessage("screen"); break;

                case G.pixel: _goCurr.__go.SendMessage("pixel"); break;

                case G.screenPos: _goCurr.__go.SendMessage("screenPos"); break;

                case G.pixelPos: _goCurr.__go.SendMessage("pixelPos"); break;

                case G.screenSize: _goCurr.__go.SendMessage("screenSize"); break;

                case G.pixelSize: _goCurr.__go.SendMessage("pixelSize"); break;
                }
            }
            else if (key is L)
            {
                switch ((L)key)
                {
                case L.range: _goCurr.lrange((float)arg[i++]); break;

                case L.spotAngle: _goCurr.lspotAngle((float)arg[i++]); break;

                case L.intensity: _goCurr.lintensity((float)arg[i++]); break;
                }
            }
            else
            {
                switch ((string)key)
                {
                case "p": _goCurr.p((Vector3)arg[i++]); break;

                case "x": _goCurr.x((float)arg[i++]); break;

                case "y": _goCurr.y((float)arg[i++]); break;

                case "z": _goCurr.z((float)arg[i++]); break;

                case "r": _goCurr.r((Vector3)arg[i++]); break;

                case "rx": _goCurr.rx((float)arg[i++]); break;

                case "ry": _goCurr.ry((float)arg[i++]); break;

                case "rz": _goCurr.rz((float)arg[i++]); break;

                case "s": _goCurr.s((Vector3)arg[i++]); break;

                case "sx": _goCurr.sx((float)arg[i++]); break;

                case "sy": _goCurr.sy((float)arg[i++]); break;

                case "sz": _goCurr.sz((float)arg[i++]); break;

                case "name": _goCurr.name((string)arg[i++]); break;

                case "com": _goCurr.com((string)arg[i++]); break;

                case "com-": _goCurr.com_((string)arg[i++]); break;

                case "msg": _goCurr.msg((string)arg[i++]); break;

                case "C": _goCurr.c((Color)arg[i++]); break;

                case "R": _goCurr.cr((float)arg[i++]); break;

                case "G": _goCurr.cg((float)arg[i++]); break;

                case "B": _goCurr.cb((float)arg[i++]); break;

                case "A": _goCurr.ca((float)arg[i++]); break;

                case "brightness": _goCurr.brightness((float)arg[i++]); break;

                case "t(": i = _goCurr.tw(i, arg); break;

                case "text": _goCurr.text((string)arg[i++], 0); break;

                case "text+": _goCurr.text((string)arg[i++], 1); break;

                case "+text": _goCurr.text((string)arg[i++], 2); break;

                case "active": _goCurr.active((bool)arg[i++]); break;
                }
            }
        }
        _goCurr.flush();
        return(_goCurr.__go);
    }