Created
September 11, 2013 22:41
-
-
Save DevJohnC/6530780 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void ShutdownComputer(IDevice computer, ISecurityCredentials credentials) | |
| { | |
| ServiceHelper.Call<ShutdownResponse>(computer, new Shutdown(), credentials, (shutdownResponse, exception) => | |
| { | |
| if (exception is API.Exceptions.PermissionDeniedException) | |
| { | |
| // pincode required for call, prompt user for it in full version | |
| if (credentials == null) | |
| { | |
| var dummyCredentials = new API.Security.PinCode | |
| { | |
| Code = "1234", | |
| CodeId = "56", | |
| UserId = Guid.NewGuid() | |
| }; | |
| ShutdownComputer(computer, dummyCredentials); | |
| } | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment