Toasts – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | Windows Toast Notifications |
2 | ======================== |
||
3 | |||
4 | C# demo project for easily creating toast-style notifications in a Windows application. |
||
5 | |||
6 | Original modified and cleaned up version of code mentioned in Attribution section below was for use in [EDGE Shop Flag Notifier](http://www.autopoint.com/helpdesk) (click on Add-Ons tab). |
||
7 | |||
8 | Features |
||
9 | --------------------- |
||
10 | |||
11 | * **Toast-Style Notifications** |
||
12 | * Notifications that pop up near the system tray |
||
13 | * **Notification Animations** |
||
14 | * 4 different ways that a notification can appear (slide, fade, roll, center) and from 4 different directions (up, down, left, right) |
||
15 | * **Custom Duration** |
||
16 | * Notifications can be sticky (click to dismiss) or can disappear based on the defined lifetime |
||
17 | * **Sounds** |
||
18 | * Easy to add sounds to the notifications |
||
19 | |||
20 | Demo |
||
21 | --------------------- |
||
22 | |||
23 | Simply build and run the solution. Demo notification launcher allows you to test out the different customizations available. |
||
24 | |||
25 | How to Use |
||
26 | --------------------- |
||
27 | |||
28 | 1. Add the following class files to your project: |
||
29 | - FormAnimator.cs |
||
30 | - NativeMethods.cs |
||
31 | 2. Add the Notifications form files to your project: |
||
32 | - Notification.cs |
||
33 | - Notification.designer.cs |
||
34 | - Notification.resx |
||
35 | 3. Customize the appearance of the Notification form |
||
36 | - Size, color, background (demo uses an image for the background) |
||
37 | 4. Create a toast notification form object in your project's code and call Show() to display it |
||
38 | |||
39 | ```csharp |
||
40 | Notification toastNotification = new Notification(title, body, duration, animationMethod, animationDirection); |
||
41 | toastNotification.Show(); |
||
42 | ``` |
||
43 | |||
44 | Attribution |
||
45 | --------------------- |
||
46 | |||
47 | Core code originally retrieved from URL below. No license information supplied. |
||
48 | * http://www.vbforums.com/showthread.php?t=547778 |