本文整理汇总了C#中NativeActivityContext.CreateTwilioBookmark方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityContext.CreateTwilioBookmark方法的具体用法?C# NativeActivityContext.CreateTwilioBookmark怎么用?C# NativeActivityContext.CreateTwilioBookmark使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeActivityContext
的用法示例。
在下文中一共展示了NativeActivityContext.CreateTwilioBookmark方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
protected override void Execute(NativeActivityContext context)
{
var twilio = context.GetExtension<ITwilioContext>();
var duration = Duration.Get(context);
GetElement(context).Add(
new XElement("Pause",
new XAttribute("length", (int)duration.TotalSeconds)),
new XElement("Redirect",
twilio.ResolveBookmarkUrl(context.CreateTwilioBookmark(this))));
}
示例2: ExecuteNoun
protected override void ExecuteNoun(NativeActivityContext context)
{
var twilio = context.GetExtension<ITwilioContext>();
var name = Name.Get(context);
// add new Number element
var element = new XElement("Queue",
name);
GetElement(context).Add(element);
// bookmark to execute Caller activity
if (Pickup != null)
element.Add(new XAttribute("url",
twilio.ResolveBookmarkUrl(context.CreateTwilioBookmark(OnPickup))));
}
示例3: ExecuteNoun
protected override void ExecuteNoun(NativeActivityContext context)
{
var twilio = context.GetExtension<ITwilioContext>();
var number = Number.Get(context);
var sendDigits = SendDigits.Get(context);
// add new Number element
var element = new XElement("Number",
!string.IsNullOrWhiteSpace(sendDigits) ? new XAttribute("sendDigits", sendDigits) : null,
number);
GetElement(context).Add(element);
// bookmark to execute Called activity
if (Pickup != null)
element.Add(new XAttribute("url", twilio.ResolveBookmarkUrl(context.CreateTwilioBookmark(OnPickup))));
}
示例4: ExecuteNoun
protected override void ExecuteNoun(NativeActivityContext context)
{
var twilio = context.GetExtension<ITwilioContext>();
// insert Sip element
var element = new XElement("Sip");
GetElement(context).Add(element);
if (Called != null)
// url attribute will execute the Called activity
element.Add(new XAttribute("url",
twilio.ResolveBookmarkUrl(context.CreateTwilioBookmark(OnCalled))));
// schedule URI activities
if (Uris.Count > 0)
{
twilio.SetElement(context, element);
foreach (var uri in Uris)
context.ScheduleActivity(uri);
}
}