Esempio n. 1
0
        public override IDictionary <string, EntityProperty> WriteEntity(OperationContext operationContext)
        {
            var properties = base.WriteEntity(operationContext);

            properties.Add(nameof(DrinkType), new EntityProperty(DrinkType.ToString()));
            return(properties);
        }
        public static Attachment ChooseDrinkSubTypeCard(DrinkType drinkType)
        {
            HeroCard whatCanYouDoCard = new HeroCard();
            var      data             = new List <string> {
                "红茶", "绿茶", "猫屎咖啡", "黑糖玛奇朵咖啡", "酸奶", "纯牛奶"
            };
            int    drinkTypeNum    = Convert.ToInt32(drinkType);
            string drinkTupeString = drinkType.ToString();

            whatCanYouDoCard.Title   = "Please choose the sub type of drink you want.";
            whatCanYouDoCard.Buttons = new List <CardAction>()
            {
                new CardAction
                {
                    Type  = ActionTypes.ImBack,
                    Value = data[drinkTypeNum],
                    Title = data[drinkTypeNum]
                },
                new CardAction
                {
                    Type  = ActionTypes.ImBack,
                    Value = data[drinkTypeNum + 1],
                    Title = data[drinkTypeNum + 1]
                },
            };

            return(whatCanYouDoCard.ToAttachment());
        }
        public static AdaptiveCard CreateDrinkCard(DrinkType drinkType)
        {
            AdaptiveCard drinkCard = new AdaptiveCard(schemaVersion);
            var          data      = new List <string> {
                "红茶", "绿茶", "猫屎咖啡", "黑糖玛奇朵咖啡", "酸奶", "纯牛奶"
            };
            int    drinkTypeNum    = Convert.ToInt32(drinkType);
            string drinkTupeString = drinkType.ToString();

            drinkCard.Body.Add
            (
                new AdaptiveTextBlock()
            {
                Color  = AdaptiveTextColor.Attention,
                Weight = AdaptiveTextWeight.Bolder,
                Size   = AdaptiveTextSize.Medium,
                Text   = string.Format("Please choose the {0} type of drink you want!", drinkTupeString),
                //HorizontalAlignment = AdaptiveHorizontalAlignment.Center,
            }
            );
            drinkCard.Body.Add(
                new AdaptiveChoiceSetInput()
            {
                Id    = drinkTupeString,
                Style = AdaptiveChoiceInputStyle.Compact,
                //IsRequired=false,
                IsMultiSelect = false,
                Value         = drinkTupeString,
                Choices       = new List <AdaptiveChoice>()
                {
                    new AdaptiveChoice()
                    {
                        Title = data[drinkTypeNum],
                        Value = data[drinkTypeNum],
                    },
                    new AdaptiveChoice()
                    {
                        Title = data[drinkTypeNum + 1],
                        Value = data[drinkTypeNum + 1],
                    }
                }
            }
                );
            drinkCard.Actions.Add
            (
                new AdaptiveSubmitAction()
            {
                Title = string.Format("Order the \"{0}\" drink", drinkTupeString),
            }
            );
            return(drinkCard);
        }
        public static Attachment CreateChoiceCard(DrinkType drinkType)
        {
            var data = new List <string> {
                "红茶", "绿茶", "猫屎咖啡", "黑糖玛奇朵咖啡", "酸奶", "纯牛奶"
            };
            int          drinkTypeNum    = Convert.ToInt32(drinkType);
            string       drinkTupeString = drinkType.ToString();
            AdaptiveCard drinkCard       = new AdaptiveCard(schemaVersion);

            drinkCard.Body.Add
            (
                new AdaptiveContainer()
            {
                Items = new List <AdaptiveElement>()
                {
                    new AdaptiveTextBlock()
                    {
                        Color  = AdaptiveTextColor.Attention,
                        Weight = AdaptiveTextWeight.Bolder,
                        Size   = AdaptiveTextSize.Medium,
                        Text   = "Please choose the type of drink you want!",
                        HorizontalAlignment = AdaptiveHorizontalAlignment.Center,
                    },
                    new AdaptiveChoiceSetInput()
                    {
                        Id            = drinkTupeString,
                        Style         = AdaptiveChoiceInputStyle.Compact,
                        IsMultiSelect = false,
                        Value         = drinkTupeString,
                        Choices       = new List <AdaptiveChoice>()
                        {
                            new AdaptiveChoice()
                            {
                                Title = data[drinkTypeNum],
                                Value = data[drinkTypeNum],
                            },
                            new AdaptiveChoice()
                            {
                                Title = data[drinkTypeNum + 1],
                                Value = data[drinkTypeNum + 1],
                            }
                        }
                    }
                }
            }
            );
            return(new Attachment()
            {
                Content = drinkCard,
                ContentType = AdaptiveCard.ContentType
            });
        }
Esempio n. 5
0
 private void UpdateDrinks()
 {
     if (drinkHolder.gameObject.activeSelf)
     {
         // nur die ersten 6 - die anderen sind die seitennavigation
         for (int i = 1; i <= 6; i++)
         {
             //Debug.Log(i + " von " + buttons.Length);
             DrinkType drinkType = isFirstPage ? (DrinkType)i : (DrinkType)(i + 6);
             buttons[i - 1].text = drinkType.ToString();
             //Debug.Log(buttons[i - 1].transform.name + " " + drinkType.ToString());
         }
     }
 }
Esempio n. 6
0
 private void updateUI(Material material, DrinkType drinkType, Status status)
 {
     matRenderer.material = material;
     orderText.text       = drinkType.ToString();
     statusText.text      = status.ToString();
 }