private void EnsureLytroStars(Json.ViewItem viewItem)
        {
            global::System.Diagnostics.Debug.Assert(viewItem != null);

            if (viewItem.VendorContent is Json.LytroStars)
            {
                return;
            }

            viewItem.VendorContent = new Json.LytroStars();
        }
        /// <summary>
        /// Ensures a com.lytro.stars instance in the Json.Picture.ViewArray.
        /// </summary>
        protected void EnsureLytroStars()
        {
            if (JsonPicture.ViewArray == null || JsonPicture.ViewArray.Length < 1)
            {
                JsonPicture.ViewArray = new Json.ViewItem[1];
            }

            int emptyIndex = -1;

            for (int i = 0; i < JsonPicture.ViewArray.Length; i++)
            {
                if (JsonPicture.ViewArray[i] == null)
                {
                    emptyIndex = i;
                }
                else if (JsonPicture.ViewArray[i].Type == Json.LytroStars.Key)
                {
                    EnsureLytroStars(JsonPicture.ViewArray[i]);
                    return;
                }
            }

            Json.ViewItem newItem = new Json.ViewItem
            {
                Type          = Json.LytroStars.Key,
                VendorContent = new Json.LytroStars()
            };

            if (emptyIndex >= 0)
            {
                JsonPicture.ViewArray[emptyIndex] = newItem;
            }
            else
            {
                JsonPicture.ViewArray = JsonPicture.ViewArray.Append(newItem);
            }
        }