MediaCenterEnvironment.DialogNotification Method
Displays a modeless notification dialog box.
Syntax
public DialogResult
DialogNotification(
string
text
,
IEnumerable
buttons
,
int
timeout
,
string
imagePath
);
public DialogResult
DialogNotification(
string
text
,
IEnumerable
buttons
,
int
timeout
,
string
imagePath
DialogClosedCallback
callback
,
);
Parameters
text
System.String. The text for the body of the dialog box.
buttons
System.Collections.IEnumerable. A collection of strings and integers that defines the buttons to include in the dialog box. For each string in the collection, the method adds a custom button that contains the string. For each number, the method creates a standard button. The standard buttons have the following values:
Value | Description |
1 | OK button |
2 | Cancel button |
4 | Yes button |
8 | No button |
timeout
System.Int32. The time-out duration, in seconds, for the dialog box, at the end of which the dialog box will automatically close. Modeless dialog boxes have a time-out duration range between 5-120 seconds.
imagePath
System.String. The path to the image to display in the dialog box. The resx:// protocol is supported when specifying a path to a managed assembly.
callback
Microsoft.MediaCenter.DialogClosedCallback. For modeless dialog boxes, this parameter specifies the DialogClosedCallback delegate that Windows Media Center invokes when the dialog box is dismissed. Windows Media Center passes a value to the delegate that indicates how the dialog box was dismissed. For modal dialog boxes, use the return value to determine how the dialog box was dismissed.
Return Value
DialogResult. A member of the DialogResult enumeration that indicates how the dialog box was dismissed. This method returns DialogResult.Active when it succeeds, indicating that the dialog box is active. If a different value is returned, this method failed.
Remarks
A notification dialog box is a window that appears briefly to notify the user of a particular event. It displays an image, text, and the specified buttons. The dialog box disappears when the user clicks a button, or when the associated time-out duration expires.
You can specify Unicode characters using \uNNNN notation, where NNNN indicates the Unicode character.
Requirements
Reference: Microsoft.MediaCenter
Namespace: Microsoft.MediaCenter
Assembly: Microsoft.MediaCenter.dll
Platform: Windows Vista Ultimate, Windows Vista Home Premium, and later
See Also