public ArticlesController(IArticleModel article, ITagCollection tagColl)
 {
     _artColl  = new ArticleCollection();
     _articles = new List <Models.ArticleModel>();
     _tags     = new List <TagDto>();
     _article  = article;
     _tagColl  = tagColl;
 }
Ejemplo n.º 2
0
        /// <summary>Extends the clone mechanics of all the tags to collections</summary>
        /// <param name="Values">The values of sub tags to convert</param>
        /// <returns>Extends the clone mechanics of all the tags to collections</returns>
        public static List <ITag> Clone(this ITagCollection Values)
        {
            Int32 Count = Values.Count;
            var   Out   = new List <ITag>(Count);

            for (Int32 I = 0; I < Count; I++)
            {
                Out.Add(Values[I].Clone());
            }

            return(Out);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="other"></param>
        /// <param name="overrideOldValues">If true, old tags that also exist in 'other' collection will be removed before new values are imported. Otherwise new values will be added to the set together with old values.</param>
        public void AddOrUpdateFrom(ITagCollection other, bool overrideOldValues = false)
        {
            if (other == null)
                return;

            if(overrideOldValues)
            {
                foreach(var tag in other)
                {
                    if (Storage.ContainsKey(tag.Key))
                        Storage[tag.Key].Clear();
                }
            }

            foreach(var tag in other)
            {
                Storage.EnsureKeyExists(tag.Key);

                Storage[tag.Key].Add(tag.Value);
            }
        }
Ejemplo n.º 4
0
 protected bool TryGetAllTags(out ITagCollection outTags)
 {
     outTags = Context.TagManager.AllTags;
     return(outTags != null && outTags.Count > 0);
 }