public void RemoveTypeFromFilter(string typeAsString)
        {
            DisplayContentList.Clear();
            ContentType type;

            Enum.TryParse(typeAsString, out type);
            filterList.Remove(type);
            FilterContentList();
        }
        public void AddContentToContentList(ContentType type, string name)
        {
            RemoveContentFromContentLists(name);
            var newContent = new ContentIconAndName(ContentIconAndName.GetContentTypeIcon(type), name);

            DisplayContentList.Add(newContent);
            ContentList.Add(newContent);
            SubContentManager.AddSubContentAndRemoveDuplicateContent(DisplayContentList, service,
                                                                     newContent);
            RaisePropertyChanged("ContentList");
        }
        public void AddTypeToFilter(string typeAsString)
        {
            DisplayContentList.Clear();
            ContentType type;

            Enum.TryParse(typeAsString, out type);
            if (!filterList.Contains(type))
            {
                filterList.Add(type);
            }
            FilterContentList();
        }
 private void RemoveContentFromContentLists(string contentName)
 {
     for (int index = 0; index < DisplayContentList.Count; index++)
     {
         var content = DisplayContentList[index];
         if (content.Name == contentName)
         {
             DisplayContentList.Remove(content);
             ContentList.Remove(content);
         }
     }
 }
 public void DeleteContentWithSubContent()
 {
     for (int index = 0; index < SelectedContentList.Count; index++)
     {
         var contentName         = SelectedContentList[index];
         var content             = DisplayContentList.ToList().Where(c => c.Name == contentName);
         var contentIconAndNames = content as IList <ContentIconAndName> ?? content.ToList();
         if (contentIconAndNames.Any())
         {
             ContentList = contentIconAndNames.ElementAt(0).DeleteSubContent(service, ContentList);
         }
         RemoveContentFromContentLists(contentName);
     }
     ClearEntities();
     FilterContentList();
 }
        public void RefreshContentList()
        {
            if (!IsLoggedInAlready())
            {
                return;
            }
            DisplayContentList.Clear();
            ContentList.Clear();
            var foundContent = service.GetAllContentNames();

            foreach (var contentName in foundContent)
            {
                AddNewContent(contentName);
            }
            FilterContentList();
            RaisePropertyChanged("DisplayContentList");
            isShowingStartContent = true;
        }
        public void FilterContentList()
        {
            DisplayContentList.Clear();
            for (int index = 0; index < ContentList.Count; index++)
            {
                var content = ContentList[index];
                if (filterList.Count == 0 || filterList.Contains(content.GetContentType()))
                {
                    if (string.IsNullOrEmpty(SearchText) ||
                        content.Name.ToLower().Contains(SearchText.ToLower()))
                    {
                        DisplayContentList.Add(content);
                    }
                }
            }
            var list = CopyList(DisplayContentList);

            for (int index = 0; index < list.Count; index++)
            {
                var content = list[index];
                SubContentManager.AddSubContentAndRemoveDuplicateContent(DisplayContentList, service,
                                                                         content);
            }
        }
        private void GetContentBetweenLastAndNewContent(string contentName)
        {
            int indexOfLastContent =
                DisplayContentList.IndexOf(
                    DisplayContentList.FirstOrDefault(content => content.Name == lastSelectedContent));
            var indexOfNewContent =
                DisplayContentList.IndexOf(
                    DisplayContentList.FirstOrDefault(content => content.Name == contentName));

            if (indexOfLastContent < indexOfNewContent)
            {
                for (int i = 0; indexOfLastContent + i < indexOfNewContent; i++)
                {
                    SelectNewContent(indexOfLastContent, i);
                }
            }
            else if (indexOfNewContent < indexOfLastContent)
            {
                for (int i = 0; indexOfNewContent + i < indexOfLastContent; i++)
                {
                    SelectNewContent(indexOfNewContent, i);
                }
            }
        }