示例#1
0
        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
0
        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");
        }
        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));
            };
        }