コード例 #1
0
 public bool SaveTag(BlogTagItem tag)
 {
     try
     {
         var currentTags = LoadTag(tag);
         if (currentTags == null)
         {
             currentTags = tag;
         }
         else
         {
             currentTags.TagName     = tag.TagName;
             currentTags.Count       = tag.Count;
             currentTags.Weight      = tag.Weight;
             currentTags.DisplayName = tag.DisplayName;
         }
         Store.Save(currentTags);
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
コード例 #2
0
 public BlogTagItem LoadTag(BlogTagItem tag) => LoadTags().FirstOrDefault(x => x.TagName == tag.TagName);
コード例 #3
0
        public void IncreaseTagCount(BlogTagItem tag)
        {
            tag.Count++;

            SaveTag(tag);
        }