| | |
| | | using System; |
| | | using HDLSceneSiri; |
| | | using ObjCRuntime; |
| | | //using HdlSiri; |
| | | |
| | | namespace SiriKit |
| | | { |
| | | public class HDLRunSceneIntentHandlder : HDLRunSceneIntentHandling |
| | | { |
| | | |
| | | override public void ConfirmRunScene(HDLRunSceneIntent intent, Action<HDLRunSceneIntentResponse> completion) |
| | | public override void HandleHDLRunScene(HDLRunSceneIntent intent, Action<HDLRunSceneIntentResponse> completion) |
| | | { |
| | | Console.WriteLine("ConfirmRunScene"); |
| | | |
| | | //SceneDateManager sdm = new SceneDateManager(); |
| | | //if(sdm.IsLgoin) |
| | | { |
| | | //执行成功 |
| | | HDLRunSceneIntentResponse rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Success,null); |
| | | rsp.SceneName = intent.SceneName; |
| | | rsp.SuccessMessage = @"请等待..."; |
| | | completion(rsp); |
| | | } |
| | | //else |
| | | //{ |
| | | // completion(new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Error, null) { ErrorMessage = "未登录" }); |
| | | //} |
| | | |
| | | var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.InProgress, null); |
| | | completion(rsp); |
| | | } |
| | | |
| | | public override void HandleRunScene(HDLRunSceneIntent intent, Action<HDLRunSceneIntentResponse> completion) |
| | | public override void ConfirmHDLRunScene(HDLRunSceneIntent intent,Action<HDLRunSceneIntentResponse> completion) |
| | | { |
| | | Console.WriteLine("HandleRunScene"); |
| | | completion(new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Success, null)); |
| | | |
| | | //SceneDateManager sdm = new SceneDateManager(); |
| | | //if (sdm.IsLgoin) |
| | | { |
| | | //执行成功 |
| | | HDLRunSceneIntentResponse rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Success, null); |
| | | rsp.SceneName = intent.SceneName; |
| | | rsp.SuccessMessage = @"执行成功"; |
| | | completion(rsp); |
| | | } |
| | | //else |
| | | //{ |
| | | // completion(new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Error, null) { ErrorMessage = "未登录" }); |
| | | //} |
| | | |
| | | //throw new NotImplementedException(); |
| | | } |
| | | } |
| | | } |