Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int type = 99;

        int[] args = new int[10] {
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        };
        string[] strArgs = new String[3] {
            "", "", ""
        };

        if (!int.TryParse(Utility.GetQueryString(Request, "type", "99"), out type))
        {
            return;
        }

        for (int i = 0; i < 10; ++i)
        {
            if (!int.TryParse(Utility.GetQueryString(Request, "Arg" + (i + 1), "99"), out args[i]))
            {
                return;
            }
        }

        for (int i = 0; i < 3; ++i)
        {
            strArgs[i] = Utility.SecureInput(Utility.GetQueryString(Request, "StrArg" + (i + 1), ""));
        }

        Response.Clear();
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(RestAPI.Get(type, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], strArgs[0], strArgs[1], strArgs[2]));
        Response.End();
    }
Ejemplo n.º 2
0
        private async void InitRemote()
        {
            if (_isInitialized.Value)
            {
                return;
            }

            try
            {
                var models = await RestAPI.Get(ApiEndpoint);

                foreach (var model in models)
                {
                    var dim = new DataDimension();
                    dim.Column      = model["column"].Value <string>();
                    dim.DisplayName = model["displayName"].Value <string>();
                    dim.HideTicks   = model["hideTicks"].Value <bool>();
                    dim.Ticks       = model["ticks"].Select(t => new DataDimension.Tick
                    {
                        Name  = t["name"].Value <string>(),
                        Value = t["value"].Value <float>()
                    }).ToArray();

                    _dimensions.Add(dim);
                }

                _isInitialized.OnNext(true);
            }
            catch (Exception e)
            {
                Debug.LogError(e.Message);
            }
        }
        private async void InitRemote()
        {
            try
            {
                var models = await RestAPI.Get(ApiEndpoint);

                ProcessUpdate(models);
            }
            catch (Exception e)
            {
                Debug.LogError(e);
            }
        }