protected override void OnReceivedCommand(Command command) { command.SenderConnection = this; switch (command.CommandName) { case CommandName.GetState: Console.WriteLine("Command GetState"); GetStateCommandReceived.Invoke(this, new SimpleEventArgs <QueryStateCommand> { Value = (QueryStateCommand)command }); break; case CommandName.Diff: Console.WriteLine("Command Diff"); DiffCommandReceived.Invoke(this, new SimpleEventArgs <DiffCommand> { Value = (DiffCommand)command }); break; case CommandName.Input: Console.WriteLine("Command Input"); InputCommandReceived.Invoke(this, new SimpleEventArgs <InputCommand> { Value = (InputCommand)command }); break; case CommandName.PaintAddFigure: Console.WriteLine("Command PaintAddFigure"); PaintAddFigureCommandRecieved.Invoke(this, new SimpleEventArgs <PaintAddFigureCommand> { Value = (PaintAddFigureCommand)command }); break; case CommandName.PaintDeleteFigure: Console.WriteLine("Command PaintDeleteFigure"); PaintDeleteFigureCommandRecieved.Invoke(this, new SimpleEventArgs <PaintDeleteFigureCommand> { Value = (PaintDeleteFigureCommand)command }); break; case CommandName.ControlAccess: Console.WriteLine("Command ControllAccess"); ControlAccessCommandReceived.Invoke(this, new SimpleEventArgs <ControlAccessCommand> { Value = (ControlAccessCommand)command }); break; case CommandName.RequestControl: Console.WriteLine("Command RequestControl"); RequestControllCommandReceived.Invoke(this, new SimpleEventArgs <RequestControlCommand> { Value = (RequestControlCommand)command }); break; default: Console.WriteLine("Unknown command"); break; } }
private static void ServerWebSocketConnectionPaintAddFigureCommandRecieved(object sender, SimpleEventArgs <PaintAddFigureCommand> e) { PaintAddFigureCommandRecieved.Invoke(sender, e); }