public LinkFeedParams ModifySubscription(ObjectId recordid, ObjectId resultsid, string htmlTags, HashSet <string> keywords) { LinkFeedParams parameters = null; if (links.ContainsKey(resultsid)) { if (links[resultsid].htmlTags == htmlTags) { links[resultsid].ReplaceKeywords(keywords); parameters = links[resultsid]; } else { IHtmlRecord record = DataManager.Instance.GetHtmlRecord(recordid); record.RemoveResults(resultsid, id); IHtmlResults results = record.AddResults(htmlTags, id); parameters = new LinkFeedParams(record.recordid, results.resultsid, record.domain.AbsoluteUri, results.htmlTags, keywords); DataManager.Instance.SaveHtmlRecord(record); links.Add(results.resultsid, parameters); } } return(parameters); }
public void RemoveAllLinks() { foreach (LinkFeedParams linkParams in links.Values) { IHtmlRecord record = DataManager.Instance.GetHtmlRecord(linkParams.recordid); record.RemoveResults(linkParams.resultsid, id); } }
public void RemoveLink(ObjectId resultsid) { if (links.ContainsKey(resultsid)) { ObjectId recordid = links[resultsid].recordid; IHtmlRecord record = DataManager.Instance.GetHtmlRecord(recordid); record.RemoveResults(resultsid, id); links.Remove(resultsid); DataManager.Instance.SaveHtmlRecord(record); } }