Example #1
0
        //*************************************************************************
        //  Constructor: NotificationDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see
        /// cref="NotificationDialog" /> class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="NotificationDialog" /> class with a window title, icon, and
        /// notification message.
        /// </summary>
        ///
        /// <param name="title">
        /// Window title.
        /// </param>
        ///
        /// <param name="systemIcon">
        /// Icon to use within the dialog.  Should be a member of the SystemIcons
        /// class.
        /// </param>
        ///
        /// <param name="message">
        /// Notification message.
        /// </param>
        //*************************************************************************

        public NotificationDialog
        (
            String title,
            Icon systemIcon,
            String message
        )
            : this()
        {
            Debug.Assert(!String.IsNullOrEmpty(title));
            Debug.Assert(systemIcon != null);
            Debug.Assert(!String.IsNullOrEmpty(message));

            // Instantiate an object that saves and retrieves the size and position
            // settings of this dialog.  Note that the object automatically saves
            // the settings when the form closes.

            m_oNotificationDialogUserSettings =
                new NotificationDialogUserSettings(this);

            this.Text             = title;
            picNotification.Image = Bitmap.FromHicon(systemIcon.Handle);
            lblMessage.Text       = message;

            DoDataExchange(false);

            AssertValid();
        }
        //*************************************************************************
        //  Constructor: NotificationDialog()
        //
        /// <overloads>
        /// Initializes a new instance of the <see
        /// cref="NotificationDialog" /> class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="NotificationDialog" /> class with a window title, icon, and
        /// notification message.
        /// </summary>
        ///
        /// <param name="title">
        /// Window title.
        /// </param>
        ///
        /// <param name="systemIcon">
        /// Icon to use within the dialog.  Should be a member of the SystemIcons
        /// class.
        /// </param>
        ///
        /// <param name="message">
        /// Notification message.
        /// </param>
        //*************************************************************************
        public NotificationDialog(
            String title,
            Icon systemIcon,
            String message
            )
            : this()
        {
            Debug.Assert( !String.IsNullOrEmpty(title) );
            Debug.Assert(systemIcon != null);
            Debug.Assert( !String.IsNullOrEmpty(message) );

            // Instantiate an object that saves and retrieves the size and position
            // settings of this dialog.  Note that the object automatically saves
            // the settings when the form closes.

            m_oNotificationDialogUserSettings =
            new NotificationDialogUserSettings(this);

            this.Text = title;
            picNotification.Image = Bitmap.FromHicon(systemIcon.Handle);
            lblMessage.Text = message;

            DoDataExchange(false);

            AssertValid();
        }