Esempio n. 1
0
 public void Delete(Article art)
 {
     if (art != null && Articles.Contains(art))
     {
         context.Pages.Remove(art);
         context.SaveChanges();
     }
 }
        // returns the object back to whoever pushed the pageModel
        public override void ReverseInit(object returnedData)
        {
            var newArticle = returnedData as Article;

            if (!Articles.Contains(newArticle))
            {
                Articles.Add(newArticle);
            }
        }
Esempio n. 3
0
        private void DeleteArticle(Article article)
        {
            if (article == null || !Articles.Contains(article))
            {
                return;
            }

            MessageBoxResult result = MessageBox.Show("Do you want to delete this article?", "Delete article", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (result == MessageBoxResult.Yes)
            {
                Articles.Remove(article);
                _model.DeleteArticle(article);
            }
        }
Esempio n. 4
0
        private Articles AddLinearsGraphikArticles(Articles articles)
        {
            string   IDs          = this.CurrentAppli.SceneComponent.SceneGetObjectIdList(null, KD.Analysis.FilterArticle.strFilterToGetValidPlacedParent());//strFilterToGetValidPlacedHostedAndChildren
            Articles articlesList = new Articles(CurrentAppli, IDs);

            foreach (Article article in articlesList)
            {
                SegmentClassification segmentClassification = new SegmentClassification(article);
                if (segmentClassification.IsArticleLinear())// && !article.HasParent()) // && article.IsValid
                {
                    if (!articles.Contains(article))
                    {
                        articles.Add(article);
                    }
                }
            }
            return(articles);
        }