Exemple #1
0
        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);
        }
Exemple #2
0
 public void RemoveAllLinks()
 {
     foreach (LinkFeedParams linkParams in links.Values)
     {
         IHtmlRecord record = DataManager.Instance.GetHtmlRecord(linkParams.recordid);
         record.RemoveResults(linkParams.resultsid, id);
     }
 }
Exemple #3
0
 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);
     }
 }