示例#1
0
        /// <summary>
        /// Shows the ALERT box on the given context
        /// </summary>
        /// <param name="Context">The context to change</param>
        public void ShowAlertForContext(string Context)
        {
            var Event = new Messages.MEvent()
            {
                Event   = "showAlert",
                Context = Context
            };

            SocketInstance.Send(Newtonsoft.Json.JsonConvert.SerializeObject(Event));
        }
示例#2
0
        /// <summary>
        /// Changes the state for the given context
        /// </summary>
        /// <param name="State">The state value</param>
        /// <param name="Context">The context to change</param>
        public void SetState(int State, string Context)
        {
            var Event = new Messages.MEvent()
            {
                Event   = "setState",
                Context = Context,
                Payload = new Messages.MPayload()
                {
                    State = State
                }
            };

            SocketInstance.Send(Newtonsoft.Json.JsonConvert.SerializeObject(Event));
        }
示例#3
0
        /// <summary>
        /// Sets the display image for this context
        /// </summary>
        /// <param name="ImagePath">The path of the image file, as a PNG</param>
        /// <param name="Context">The context to change</param>
        /// <param name="Target">Which targets to apply the changes to</param>
        public void SetImage(string ImagePath, string Context, Messages.ESDSDKTarget Target)
        {
            var Event = new Messages.MEvent()
            {
                Event   = "setImage",
                Context = Context,
                Payload = new Messages.MPayload()
                {
                    Target = Target,
                    Image  = "data:image/png;base64," + Convert.ToBase64String(System.IO.File.ReadAllBytes(ImagePath))
                }
            };

            SocketInstance.Send(Newtonsoft.Json.JsonConvert.SerializeObject(Event));
        }
示例#4
0
        /// <summary>
        /// Sets the display title for this context
        /// </summary>
        /// <param name="Title">The title to change to</param>
        /// <param name="Context">The context to change</param>
        /// <param name="Target">Which targets to apply the changes to</param>
        public void SetTitle(string Title, string Context, Messages.ESDSDKTarget Target)
        {
            var Event = new Messages.MEvent()
            {
                Event   = "setTitle",
                Context = Context,
                Payload = new Messages.MPayload()
                {
                    Target = Target,
                    Title  = Title
                }
            };

            SocketInstance.Send(Newtonsoft.Json.JsonConvert.SerializeObject(Event));
        }