C# Class Bloom.MiscUI.ToastNotifier

Like a notification ballon, but more reliable "toast" because it slowly goes up, then down. Subscribe to the Click event to know if the user clicked on it. Note: currently clicking on the image or text invoke the click event, not just the action link. Note: don't use a lot of these. They hang around off-screen. (See comment in GoDownTimerTick.) It's primarily intended for something like "updates are available" that happens once per run of the program. Usage: var notifier = new ToastNotifier(); notifier.Image.Image = {some small Image, about 32x32}; notifier.ToastClicked += (sender, args) => {do something}; notifier.Show("You should know this", "Something you might do about it", {some # of seconds}); You should NOT dispose of the notifier, since we haven't found a safe time to even close it.
Inheritance: System.Windows.Forms.Form
Show file Open project: BloomBooks/BloomDesktop Class Usage Examples

Public Properties

Property Type Description
Image System.Windows.Forms.PictureBox
WarningBitmap Image

Public Methods

Method Description
Show ( string message, string callToAction, int seconds ) : void

Show the toast

ToastNotifier ( ) : System

constructor

UpdateMessage ( string newMessage ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

OnLoad ( EventArgs e ) : void

Private Methods

Method Description
CloseThisLater ( object sender, EventArgs e ) : void
GoDownTimerTick ( object sender, EventArgs e ) : void
GoUpTimerTick ( object sender, EventArgs e ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

PauseTimerTick ( object sender, EventArgs e ) : void
ToastNotifier_Click ( object sender, EventArgs e ) : void
callToAction_LinkClicked ( object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) : void

Method Details

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

OnLoad() protected method

protected OnLoad ( EventArgs e ) : void
e System.EventArgs
return void

Show() public method

Show the toast
public Show ( string message, string callToAction, int seconds ) : void
message string
callToAction string Text of the hyperlink
seconds int How long to show before it goes back down
return void

ToastNotifier() public method

constructor
public ToastNotifier ( ) : System
return System

UpdateMessage() public method

public UpdateMessage ( string newMessage ) : void
newMessage string
return void

Property Details

Image public property

Image of your app
public System.Windows.Forms.PictureBox Image
return System.Windows.Forms.PictureBox

WarningBitmap public static property

public static Image WarningBitmap
return Image