Exemplo n.º 1
0
 public PostDto ToDto()
 {
     return(new PostDto
     {
         Id = Id,
         Title = Title.Trim(),
         LinkText = LinkText.Trim().ToLower(),
         PreviewText = PreviewText.Trim(),
         FullText = FullText.Trim(),
         PublishedAt = PublishedAt,
         Tags = Tags
                // IsPublished ignored
     });
 }
 private void btnOK_Click(object sender, System.EventArgs e)
 {
     if (LinkText == String.Empty)
     {
         DisplayMessage.Show(MessageId.NoLinkTextSpecified, this);
         txtText.Focus();
     }
     else if (Url.Trim() == String.Empty || Url.Trim() == HTTP_PREFIX)
     {
         DisplayMessage.Show(MessageId.NoValidHyperlinkSpecified, this);
     }
     else if (!_edit && IsAlreadyInGlossary(LinkText.Trim()))
     {
         if (DisplayMessage.Show(MessageId.ConfirmReplaceEntry) == DialogResult.Yes)
         {
             DialogResult = DialogResult.OK;
         }
     }
     else
     {
         DialogResult = DialogResult.OK;
     }
 }