コード例 #1
0
        private void OnWallpaperReceived(SetWallpaperCommand command)
        {
            string path = Path.Combine(Environment.CurrentDirectory, "temp_wallpaper.wllpr");

            if (File.Exists(path))
            {
                File.Delete(path);
            }

            logViewer.WriteLine("New wallpaper received (" + command.Style + ")");

            command.Image.Save(path);
            command.Image.Dispose();
            Wallpaper.Set(new Uri(path), command.Style);
            File.Delete(path);
        }
コード例 #2
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;
            }
        }