C# Class SevenSoftware.Windows.Dialogs.TaskDialog.NativeTaskDialog

Encapsulates the native logic required to create, configure, and show a TaskDialog, via the TaskDialogIndirect() Win32 function.
A new instance of this class should be created for each messagebox show, as the HWNDs for TaskDialogs do not remain constant across calls to TaskDialogIndirect.
Inheritance: IDisposable
Mostra file Open project: robertbaker/SevenUpdate Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Finalizes an instance of the NativeTaskDialog class.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources.

Private Methods

Method Description
AllocateAndMarshalButtons ( ICollection buttons ) : IntPtr

Allocates and marshals buttons.

AssertCurrentlyShowing ( ) : void

Show debug message when the native dialog is showing.

DialogProc ( IntPtr windowHandle, uint message, IntPtr parameter, IntPtr parameterLength, IntPtr referenceData ) : int

Processes dialog messages.

FreeOldString ( TaskDialogElements element ) : void

Frees the old string.

HandleButtonClick ( int id ) : int

Once the task dialog HWND is open, we need to send additional messages to configure it.

HandleHelpInvocation ( ) : int

Handles the help invocation.

HandleHyperlinkClick ( IntPtr reference ) : int

Handles the hyperlink click.

HandleRadioButtonClick ( int id ) : int

Handles the radio button click.

HandleTick ( int ticks ) : int

Handles timer ticks.

IsOptionSet ( TaskDialogOptions flag ) : bool

Determines whether the options are set for the dialog

MakeLongLongParam ( int a, int b ) : long

Makes a Long parameter.

MakeNewString ( string text, TaskDialogElements element ) : IntPtr

Allocates a new string on the unmanaged heap, and stores the pointer so we can free it later.

MarshalDialogControlStructs ( ) : void

Checks to see if the given element already has an updated string, and if so, frees it. This is done in preparation for a call to MakeNewString(), to prevent leaks from multiple updates calls on the same element within a single native dialog lifetime.

Builds the actual configuration that the NativeTaskDialog (and underlying Win32 API) expects, by parsing the various control lists, marshaling to the unmanaged heap, etc.

NativeClose ( TaskDialogResult result ) : void

The new task dialog does not support the existing Win32 functions for closing (e.g. EndDialog()); instead, a "click button" message is sent. In this case, we're abstracting out to say that the TaskDialog consumer can simply call "Close" and we'll "click" the cancel button. .

NativeShow ( ) : void

Shows the native dialog.

NativeTaskDialog ( NativeTaskDialogSettings settings, TaskDialog outerDialog ) : System

Initializes a new instance of the NativeTaskDialog class.

PerformDialogCleanup ( ) : int

Performs the dialog cleanup.

PerformDialogInitialization ( ) : int

Performs the dialog initialization.

SendMessageHelper ( TaskDialogMessages message, int parameter, long parameterLength ) : int

Sends a message to the dialog.

UpdateButtonEnabled ( int buttonId, bool enabled ) : void

Updates the button enabled.

UpdateCheckBoxChecked ( bool isChecked ) : void

Updates the check box checked.

UpdateElevationIcon ( int buttonId, bool showIcon ) : void

Updates the elevation icon.

UpdateExpandedText ( string expandedText ) : void

Updates the expanded text.

UpdateFooterIcon ( TaskDialogStandardIcon footerIcon ) : void

Updates the footer icon.

UpdateFooterText ( string footerText ) : void

Updates the footer text.

UpdateIconCore ( TaskDialogStandardIcon icon, TaskDialogIconElement element ) : void

Updates the icon.

UpdateInstruction ( string instruction ) : void

Updates the instruction.

UpdateMainIcon ( TaskDialogStandardIcon mainIcon ) : void

Updates the main icon.

UpdateProgressBarRange ( ) : void

Updates the progress bar range.

UpdateProgressBarState ( TaskDialogProgressBarState state ) : void

Updates the state of the progress bar.

UpdateProgressBarValue ( int i ) : void

Updates the progress bar value.

UpdateRadioButtonEnabled ( int buttonId, bool enabled ) : void

Update the radio button when enabled has changed.

UpdateText ( string text ) : void

Updates the content text.

UpdateTextCore ( string text, TaskDialogElements element ) : void

Updates the text.

Method Details

Dispose() public method

Finalizes an instance of the NativeTaskDialog class.
public Dispose ( ) : void
return void

Dispose() protected method

Releases unmanaged and - optionally - managed resources.
protected Dispose ( bool disposing ) : void
disposing bool Release both managed and unmanaged resources; False to release only unmanaged resources.
return void