public async void CloseWallpaper(params uint[] screenIndexs) { try { using var cts = new CancellationTokenSource(); cts.CancelAfter(TimeSpan.FromSeconds(10)); var para = new CloseWallpaperRequest(); para.ScreenIndexs.AddRange(screenIndexs); var reply = await _client.CloseWallpaperAsync(para); } catch (Exception) { } }
public override Task <Empty> CloseWallpaper(CloseWallpaperRequest request, ServerCallContext context) { WallpaperManager.Instance.CloseWallpaper(request.ScreenIndexs.ToArray()); return(Task.FromResult(new Empty())); }