コード例 #1
0
 void m_client_OnCommandReceived(object sender, CommandReceivedArgs e)
 {
     if (InvokeRequired)
     {
         this.BeginInvoke((MethodInvoker) delegate
         {
             OnCommandReceived(e);
         });
     }
     else
     {
         OnCommandReceived(e);
     }
 }
コード例 #2
0
 void m_serverHandler_OnCommandReceived(object sender, CommandReceivedArgs e)
 {
     if (InvokeRequired)
     {
         BeginInvoke((MethodInvoker) delegate
         {
             OnCommandReceived(e);
         });
     }
     else
     {
         OnCommandReceived(e);
     }
 }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
        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;
            }
        }