Пример #1
0
        //Update
        public bool UpdateExistingContent(string originalTitle, StreamingContent newContent)
        {
            //Find the content
            StreamingContent oldContent = GetContentByTitle(originalTitle);

            //Update the content
            if (oldContent != null)
            {
                oldContent.Title            = newContent.Title;
                oldContent.Description      = newContent.Description;
                oldContent.MaturityRating   = newContent.MaturityRating;
                oldContent.IsFamilyFriendly = newContent.IsFamilyFriendly;
                oldContent.StarRating       = newContent.StarRating;
                oldContent.TypeOfGenre      = newContent.TypeOfGenre;

                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        //Delete
        public bool RemoveContentFromList(string title)
        {
            StreamingContent content = GetContentByTitle(title);

            if (content == null)
            {
                return(false);
            }

            int initialCount = _listOfContent.Count;

            _listOfContent.Remove(content);

            if (initialCount > _listOfContent.Count)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
 //Create
 public void AddContentToList(StreamingContent content)
 {
     _listOfContent.Add(content); //Fields have underscores. Properties don't
 }