Esempio n. 1
0
 public bool AddHyperlink(HyperlinkItem hyperlink)
 {
     if (string.IsNullOrEmpty(hyperlink.Topic) || string.IsNullOrEmpty(hyperlink.Url) || string.IsNullOrEmpty(hyperlink.DelimitedKeyPhraseList))
     {
         return(false);
     }
     else
     {
         EnsureState();
         keyPhraseLibrary.AddKeyPhrases(hyperlink.DelimitedKeyPhraseList);
         repository.SaveKeyPhrases(keyPhraseLibrary.DelimitKeyPhraseList());
         repository.SaveHyperlink(hyperlink);
         RefreshHyperlinks();
         this.selectedHyperlink = this.HyperlinkList.Where(r => r.Id == hyperlink.Id).SingleOrDefault();
         return(true);
     }
 }