예제 #1
0
 public void SendButton(JSONButton button, IClientInfo client = null)
 {
     if (client == null)
     {
         foreach (IClientInfo clientInfo in this.TCPServer.GetConnectedClients().Values)
         {
             this.SendButton(button, clientInfo);
         }
     }
     else
     {
         this.TCPServer.SendFile(client.Id, button.Icon, button.Icon);
         Console.WriteLine("Icon Sent File Sent");
         this.TCPServer.SendMessage(client.Id, button.ToString());
         Console.WriteLine("Info JSON Sent");
         if (button.Scope == Actions.ActionScope.Client)
         {
             switch (button.ActionCMD)
             {
             case "SOUND":
                 this.TCPServer.SendFile(client.Id, button.ActionArgs, button.ActionArgs); Console.WriteLine("Sent " + button.ActionArgs); break;
             }
         }
     }
 }
예제 #2
0
        public void AddButton(JSONButton button)
        {
            if (this.Scope == ActionScope.Server)
            {
                this.Server.SendButton(button);
            }
            this.Buttons.Add(button);
            EventHandler <ButtonAddedEventArgs> handler = onButtonAdded;

            if (handler != null)
            {
                handler(null, new ButtonAddedEventArgs(this.Scope, button));
            }
        }
예제 #3
0
 private void TCPClient_MessageReceived(SimpleSocketClient client, string msg)
 {
     Debug.WriteLine("Message Received: " + msg);
     this.Engine.AddButton(JSONButton.FromJSON(msg));
 }