コード例 #1
0
        public JsonResult SetText(SetTextRequest model)
        {
            var request = $"{AppSettings.Api}setText".PostJsonToUrl(
                new
            {
                apikey = AppSettings.ApiKey,
                padID  = model.PadId,
                text   = model.Text
            });

            var responce = JsonConvert.DeserializeObject <SetTextResponce>(request);

            return(Json(responce));
        }
コード例 #2
0
        private void OnAddonSetEvent(AAddon addon)
        {
            try
            {
                ARequest      request          = null;
                VisibleObject objectProperties = new VisibleObject();

                switch (addon.Type)
                {
                case AddonType.D3dImage:
                    request = new SetImageRequest();

                    ((SetImageRequest)request).Filename = ((ImageD3dVisibleAddon)addon).ImageFilename;
                    objectProperties.Id     = addon.Id;
                    objectProperties.Layout = ((ImageD3dVisibleAddon)addon).Layout;
                    ((SetImageRequest)request).ImageProperties = objectProperties;
                    break;

                case AddonType.D3dText:
                    request = new SetTextRequest();

                    ((SetTextRequest)request).Text = ((TextD3dVisibleAddon)addon).Text;
                    objectProperties.Id            = addon.Id;
                    objectProperties.Layout        = ((TextD3dVisibleAddon)addon).Layout;

                    ((SetTextRequest)request).ObjectProperties = objectProperties;
                    break;

                default:
                    break;
                }
                _playerCommunicatorControl.SendRequest(request);
            }
            catch (System.Exception)
            {
            }
        }