Exemplo n.º 1
0
        // Update
        public bool UpdateExistingContent(string originalTitle, StreamingContent newContent)
        {
            //Find tthe 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 3
0
 // C R U D
 // Create
 public void AddContentToList(StreamingContent content)
 {
     _listofContent.Add(content);
 }