Exemple #1
0
        public void RemoveResults(ObjectId resultsid, ObjectId userid)
        {
            HtmlResults htmlResults = results[resultsid];

            htmlResults.RemoveResultsOwner(userid);
            if (htmlResults.owners.Count == 0)
            {
                results.Remove(resultsid);
            }
        }
Exemple #2
0
        public IHtmlResults AddResults(string htmlTags, ObjectId userid)
        {
            IEnumerable <IHtmlResults> existingResults = results.Values.Where(val => val.htmlTags == htmlTags);

            if (existingResults.Count() == 0)
            {
                HtmlResults newResults = new HtmlResults(htmlTags);
                newResults.AddResultsOwner(userid);
                results.Add(newResults.resultsid, newResults);
                return(newResults as IHtmlResults);
            }
            else if (existingResults.Count() == 1)
            {
                existingResults.First().AddResultsOwner(userid);
                return(existingResults.First());
            }
            else
            {
                throw new Exception();
            }
        }