Пример #1
0
        public static void ReportToolOptionDataValueChange(string tool, string toolOption, string value)
        {
            ToolUpdateRootObject toolUpdateRootObject = new ToolUpdateRootObject
            {
                tool_id      = tool,
                message_type = "tool_update",
                session_id   = sessionId,
                show_overlay = "true",
                tool_options = new List <ToolOption> {
                    new ToolOption {
                        name = toolOption, value = value
                    }
                }
            };

            string s = JsonConvert.SerializeObject(toolUpdateRootObject);

            client.Send(s);

            Trace.TraceInformation("MyWebSocket.ReportToolOptionDataValueChange - Tool:{0}, Tool option:{1}, Value:{2} ", tool, toolOption, value);
        }
Пример #2
0
        public async Task SetToolValue(string toolName, string toolOption, string value)
        {
            try
            {
                ToolUpdateRootObject toolUpdateRootObject = new ToolUpdateRootObject
                {
                    tool_id      = toolName,
                    message_type = "tool_update",
                    session_id   = sessionId,
                    show_overlay = "true",
                    tool_options = new List <ToolOption> {
                        new ToolOption {
                            name = toolOption, value = value
                        }
                    }
                };

                await this.Send(toolUpdateRootObject);
            }
            catch (Exception ex)
            {
                this.LastErrorMessage = ex.Message;
            }
        }