Esempio n. 1
0
        public virtual bool ContainsTag(ITag tag)
        {
            Check.Argument.IsNotNull(tag, "tag");
            Check.Argument.IsNotEmpty(tag.Name, "tag.Name");

            return(StoryTags.Any(st => st.Tag.Name == tag.Name));
        }
Esempio n. 2
0
        public virtual void RemoveTag(ITag tag)
        {
            Check.Argument.IsNotNull(tag, "tag");
            Check.Argument.IsNotEmpty(tag.Name, "tag.Name");

            StoryTags.Remove(StoryTags.SingleOrDefault(st => st.Tag.Name == tag.Name));
        }
Esempio n. 3
0
        public void RemoveTag(ITag tag)
        {
            Check.Argument.IsNotNull(tag, "tag");
            Check.Argument.IsNotEmpty(tag.Name, "tag.Name");

            //It should load all StoryTags then remove the desired tag
            StoryTags.Remove(StoryTags.FirstOrDefault(t => t.Name == tag.Name));
        }
Esempio n. 4
0
        public virtual void AddTag(ITag tag)
        {
            Check.Argument.IsNotNull(tag, "tag");
            Check.Argument.IsNotEmpty(tag.Id, "tag.Id");
            Check.Argument.IsNotEmpty(tag.Name, "tag.Name");

            if (!ContainsTag(tag))
            {
                StoryTags.Add(new StoryTag {
                    Tag = (Tag)tag
                });
            }
        }
Esempio n. 5
0
 public void RemoveAllTags()
 {
     //It should load all UserTags then clear the collection
     StoryTags.Clear();
 }
Esempio n. 6
0
 public virtual void RemoveAllTags()
 {
     StoryTags.Clear();
 }
Esempio n. 7
0
 /// <summary>
 /// Checks if this collectible has a particular story tag.
 /// </summary>
 /// <param name="tag"></param>
 /// <returns></returns>
 public bool HasTag(string tag)
 {
     return(StoryTags != null && StoryTags.Contains(tag));
 }