Пример #1
0
        private static RecipeDataGroup CreateRecipeGroup(JsonObject obj)
        {
            RecipeDataGroup group = new RecipeDataGroup();

            foreach (var key in obj.Keys)
            {
                IJsonValue val;
                if (!obj.TryGetValue(key, out val))
                    continue;

                switch (key)
                {
                    case "key":
                        group.UniqueId = val.GetString();
                        break;
                    case "title":
                        group.Title = val.GetString();
                        break;
                    case "shortTitle":
                        group.ShortTitle = val.GetString();
                        break;
                    case "description":
                        group.Description = val.GetString();
                        break;
                    case "backgroundImage":
                        group.SetImage(val.GetString());
                        break;
                    case "groupImage" :
                        group.SetGroupImage(val.GetString());
                        break; 
                }
            }

            _recipeDataSource.AllGroups.Add(group);
            return group;
        }
Пример #2
0
 public RecipeDataItem(String uniqueId, String title, String shortTitle, String imagePath, int preptime, String directions, ObservableCollection<string> ingredients, RecipeDataGroup group)
     : base(uniqueId, title, shortTitle, imagePath)
 {
     this._preptime = preptime;
     this._directions = directions;
     this._ingredients = ingredients;
     this._group = group;
 }