Esempio n. 1
0
        public HyperlinkDialog()
        {
            InitializeComponent();

            Model = new HyperlinkObject
            {
                URL = "http://"
            };
            btnOK.Click     += new RoutedEventHandler(OkayButton_Click);
            btnCancel.Click += new RoutedEventHandler(CancelButton_Click);
        }
Esempio n. 2
0
        /// <summary>
        /// 执行插入超链接命令
        /// </summary>
        public static void InsertHyperlick(this HtmlDocument document, HyperlinkObject hyperlink)
        {
            var url = hyperlink.URL.HtmlEncoding();
            var txt = hyperlink.Text.HtmlEncoding();

            if (string.IsNullOrEmpty(txt))
            {
                txt = url;
            }
            string tx = string.Format("<a href=\"{0}\">{1}</a>", url, txt);

            document.InsertHTML(tx);
        }