using System;
|
|
using CoreGraphics;
|
using Foundation;
|
using HDLSceneSiri;
|
//using HDLSceneSiri;
|
using Intents;
|
using IntentsUI;
|
using UIKit;
|
|
namespace SiriIntentsUI
|
{
|
public partial class IntentViewController : UIViewController, IINUIHostedViewControlling
|
{
|
protected IntentViewController(IntPtr handle) : base(handle)
|
{
|
}
|
|
[Export("configureWithInteraction:context:completion:")]
|
public void Configure(INInteraction interaction, INUIHostedViewContext context, Action<CGSize> completion)
|
{
|
throw new NotImplementedException();
|
}
|
|
CGSize DesiredSize()
|
{
|
return ExtensionContext.GetHostedViewMaximumAllowedSize();
|
}
|
|
|
|
|
[Export("configureViewForParameters:ofInteraction:interactiveBehavior:context:completion:")]
|
public void ConfigureView(
|
NSSet<INParameter> parameters,
|
INInteraction interaction,
|
INUIInteractiveBehavior interactiveBehavior,
|
INUIHostedViewContext context,
|
INUIHostedViewControllingConfigureViewHandler completion)
|
{
|
|
|
|
|
HDLRunSceneIntentResponse rsp = interaction.IntentResponse as HDLRunSceneIntentResponse;
|
this.lblMsg.Text = rsp.SuccessMessage;
|
this.lblMsg.TextColor = UIColor.Black;
|
this.lblMsg.Frame = new CGRect(0, 0, DesiredSize().Width, 100);
|
CGSize size = new CGSize(DesiredSize().Width, 100);
|
|
|
if (completion != null)
|
completion(true, parameters, size);
|
|
}
|
|
|
}
|
}
|