本文整理汇总了C#中Dialog.AsResult方法的典型用法代码示例。如果您正苦于以下问题:C# Dialog.AsResult方法的具体用法?C# Dialog.AsResult怎么用?C# Dialog.AsResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialog
的用法示例。
在下文中一共展示了Dialog.AsResult方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override IEnumerable<IResult> Execute()
{
var custom = new Dialog<MemeAnswer>(DialogType.Question,
"Your favorite Meme?",
new MemeAnswer("Trollface", "Dont feed the troll !"),
new MemeAnswer("Damned", "Y U NO CODE GUD !!"),
new MemeAnswer("Forever Alone", "Story of my life..."),
new MemeAnswer("Apopleptic", "Not another VB.NET project !!!!111"));
yield return custom.AsResult()
.PrefixViewContextWith("Meme");
}
示例2: EditName
public IEnumerable<IResult> EditName()
{
LocationViewModel lvm = new LocationViewModel();
if (string.IsNullOrWhiteSpace(Address))
Address = DestinationLocation.LocationName;
lvm.Address = DestinationLocation.Address;
lvm.LocationName = DestinationLocation.LocationName;
var question = new Dialog<Answer>(DialogType.Question,
"location name",
lvm,
Answer.Ok,
Answer.Cancel);
yield return question.AsResult();
if (question.GivenResponse == Answer.Ok)
{
events.Publish(new FavoriteState(GetFavorite(DestinationLocation), false));
DestinationLocation.LocationName = lvm.LocationName;
events.Publish(new FavoriteState(GetFavorite(DestinationLocation), true));
};
}