Пример #1
0
        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)
            {
            }
        }
Пример #2
0
 public override Task <Empty> CloseWallpaper(CloseWallpaperRequest request, ServerCallContext context)
 {
     WallpaperManager.Instance.CloseWallpaper(request.ScreenIndexs.ToArray());
     return(Task.FromResult(new Empty()));
 }