-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
26 lines (25 loc) · 1.04 KB
/
MainWindow.xaml.cs
File metadata and controls
26 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System.Windows;
using DevExpress.Data;
namespace InteractiveNotifications {
public partial class MainWindow : Window {
public MainWindow() {
RegisterApplication();
InitializeComponent();
}
public static void SendActivatorMessage(string arguments) {
MessageBox.Show("Activator invoked! Notification id = " + arguments);
}
public static string ApplicationID {
get { return string.Format("InteractiveNotifications_{0}", AssemblyInfo.VersionShort.Replace(".", "_")); }
}
public static string ApplicationName {
get { return "Interactive Notifications"; }
}
void RegisterApplication() {
if(!ShellHelper.IsApplicationShortcutExist(ApplicationName)) {
ShellHelper.RegisterComServer(typeof(CustomNotificationActivator));
ShellHelper.TryCreateShortcut(ApplicationID, ApplicationName, null, typeof(CustomNotificationActivator));
}
}
}
}