Controls.Food.Options C# (CSharp) Method

Options() public method

public Options ( System.Boolean onlyselected = false ) : ItemList
onlyselected System.Boolean
return ItemList
        public ItemList Options(Boolean onlyselected = false)
        {
            if (onlyselected)
                return options.ReturnMultiple();
            else
                return options;
        }

Usage Example

示例#1
0
 private String formatOrderItem(Food item)
 {
     String amount = item.Amounts().ReturnSingle().Name();
     String name = item.Name();
     if (item.Amounts().ReturnSingle().Price() > 1) {
         name += "s"; //plural
     }
     String option = item.Options().ReturnSingle().Name();
     String size = item.SizeName();
     String price = "$" + item.Price().ToString("N2");
     if (option.ToLower().Equals("none"))
     {
         return amount + " " + size + " " + name + " " + ": " + price;
     }
     else {
         return amount + " " + size + " " + name + " " + "with " + option + ": " + price;
     }
 }