void m_client_OnCommandReceived(object sender, CommandReceivedArgs e) { if (InvokeRequired) { this.BeginInvoke((MethodInvoker) delegate { OnCommandReceived(e); }); } else { OnCommandReceived(e); } }
void m_serverHandler_OnCommandReceived(object sender, CommandReceivedArgs e) { if (InvokeRequired) { BeginInvoke((MethodInvoker) delegate { OnCommandReceived(e); }); } else { OnCommandReceived(e); } }
void OnCommandReceived(CommandReceivedArgs e) { switch (e.Command.Type) { case CommandType.Notification: NotificationCommand notifCommand = (NotificationCommand)e.Command; logViewer.WriteLine(notifCommand.Text, MessageType.Notification); break; case CommandType.SetWallpaper: SetWallpaperCommand setWallCommand = (SetWallpaperCommand)e.Command; logViewer.WriteLine("New wallpaper received from " + e.Sender.Ip); break; default: logViewer.WriteLine("Command received from " + e.Sender.Ip); break; } }
private void OnCommandReceived(CommandReceivedArgs e) { switch (e.Command.Type) { case NetworkCore.Commands.CommandType.Notification: OnNotificationReceived((NotificationCommand)e.Command); break; case NetworkCore.Commands.CommandType.SetWallpaper: OnWallpaperReceived((SetWallpaperCommand)e.Command); break; case NetworkCore.Commands.CommandType.UserJoined: OnUserJoined((UserJoinedCommand)e.Command); break; case NetworkCore.Commands.CommandType.UserLeft: OnUserLeft((UserLeftCommand)e.Command); break; } }