Beispiel #1
0
 /// <summary>
 /// Catches the close of the preview window.
 /// </summary>
 /// <param name="sender">The object sending the event.</param>
 /// <param name="e">The event.</param>
 private void catchPreviewClose( object sender, EventArgs e )
 {
     preview = null;
 }
Beispiel #2
0
        /// <summary>
        /// Preview the current promotion code.
        /// </summary>
        /// <param name="sender">The object sending the event.</param>
        /// <param name="e">The event.</param>
        private void btnPreview_Click( object sender, EventArgs e )
        {
            // If we don't have a preview form...
            if ( preview == null )
            {
                // ...create it...
                preview = new frmPromoteWorkPreview();
                // ...hook into it closing...
                preview.FormClosed += catchPreviewClose;
                // ...and show it.
                preview.Show();
            }
            else
            {
                preview.Focus();
            }

            // Bung the preview HTML code into the browser.
            preview.Preview( "<center><img src=\"" + ImageURL() + "\" /></center>" );
        }