public bool SaveTag(TagItem tag) { try { var currentTags = LoadTag(tag); if (currentTags == null) { currentTags = tag; } else { currentTags.TagName = tag.TagName; currentTags.Count = tag.Count; currentTags.Weight = tag.Weight; } Store.Save(currentTags); } catch (Exception) { return false; } return true; }
public bool SaveTag(TagItem tag) { try { var currentTags = LoadTag(tag); if (currentTags == null) { currentTags = tag; } else { currentTags.TagName = tag.TagName; currentTags.Count = tag.Count; currentTags.Weight = tag.Weight; } Store.Save(currentTags); } catch (Exception) { return(false); } return(true); }
public TagItem LoadTag(TagItem tag) { return LoadTags().Where(x => x.TagName == tag.TagName).FirstOrDefault(); }
public void IncreaseTagCount(TagItem tag) { tag.Count++; SaveTag(tag); }
public TagItem LoadTag(TagItem tag) { return(LoadTags().Where(x => x.TagName == tag.TagName).FirstOrDefault()); }