示例#1
0
        internal override DialogResult RunDialog(IWin32Window owner)
        {
            // If the dialog is already visible, then bail out.
            if (form != null)
            {
                return(DialogResult.Cancel);
            }

            // Construct the font dialog form.
            form = new FontDialogForm(this);

            // Run the dialog and get its result.
            DialogResult result;

            try
            {
                result = form.ShowDialog(owner);
                if (result != DialogResult.OK)
                {
                    font = null;
                }
            }
            finally
            {
                form.DisposeDialog();
                form = null;
            }

            // Return the final dialog result to the caller.
            return(result);
        }
	internal override DialogResult RunDialog(IWin32Window owner)
			{
				// If the dialog is already visible, then bail out.
				if(form != null)
				{
					return DialogResult.Cancel;
				}

				// Construct the font dialog form.
				form = new FontDialogForm(this);

				// Run the dialog and get its result.
				DialogResult result;
				try
				{
					result = form.ShowDialog(owner);
					if(result != DialogResult.OK)
					{
						font = null;
					}
				}
				finally
				{
					form.DisposeDialog();
					form = null;
				}

				// Return the final dialog result to the caller.
				return result;
			}