public async Task ShowWallpaper(WallpaperModel wallpaper, params uint[] screenIndexs) { try { using var cts = new CancellationTokenSource(); cts.CancelAfter(TimeSpan.FromSeconds(10)); var para = new ShowWallpaperRequest() { Wallpaper = wallpaper }; para.ScreenIndexs.AddRange(screenIndexs); _ = await _client.ShowWallpaperAsync(para); } catch (Exception) { } }
public override async Task <Empty> ShowWallpaper(ShowWallpaperRequest request, ServerCallContext context) { await WallpaperManager.Instance.ShowWallpaper(request.Wallpaper, request.ScreenIndexs.ToArray()); return(new Empty()); }