public static string CreateImageText(string baseDirectory) { string rtnVal = string.Empty; ImageForm form = new ImageForm(baseDirectory); if (form.ShowDialog() == DialogResult.OK) { string display = string.Empty; string linkText = string.Empty; string tooltip = string.Empty; if (!string.IsNullOrEmpty(form.Display)) { display = form.Display; } else { if (!string.IsNullOrEmpty(form.LinkText)) { display = form.LinkText; } } linkText = form.LinkText; tooltip = form.Tooltip; if (string.IsNullOrEmpty(linkText)) { return(string.Empty); } if (!string.IsNullOrEmpty(tooltip)) { linkText = string.Format("{0} \"{1}\"", linkText, tooltip); } rtnVal = string.Format("![{0}]({1})", display, linkText); } return(rtnVal); }