/// <summary> /// Returns the current status of optional Windows features. /// </summary> /// <returns>A dictionary mapping individual feature names to their status.</returns> public Dictionary <string, WindowsFeatureStatus> GetWindowsOptionalFeatures() { if (isAdmin) { return(NeonHelper.GetWindowsOptionalFeatures()); } else { var request = new GrpcGetWindowsOptionalFeaturesRequest(); var reply = desktopService.GetWindowsOptionalFeaturesAsync(request).Result; reply.Error.EnsureSuccess(); return(reply.Capabilities); } }
/// <inheritdoc/> public async Task <GrpcGetWindowsOptionalFeaturesReply> GetWindowsOptionalFeaturesAsync(GrpcGetWindowsOptionalFeaturesRequest request, CallContext context = default) { await SyncContext.Clear; try { return(new GrpcGetWindowsOptionalFeaturesReply(NeonHelper.GetWindowsOptionalFeatures())); } catch (Exception e) { return(new GrpcGetWindowsOptionalFeaturesReply(e)); } }