Exemple #1
0
        private void InitTrayIcon()
        {
            // Create Tray icon
            //AppData.notifyIcon = new TaskbarIcon();
            AppData.notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
            if (AppData.notifyIcon == null)
            {
                throw new ArgumentNullException("Resource: NotifyIcon");
            }

            AppData.notifyIcon.TrayRightMouseUp += AppData.MenuOpen;
            AppData.notifyIcon.ToolTipText       = StringsFunctions.ResourceString("resVersion");

            // Icons.
            AppData.imageSources[0] = ImageFunctions.GetIconFromResource("init");
            AppData.imageSources[1] = ImageFunctions.GetIconFromResource("enabled");
            AppData.imageSources[2] = ImageFunctions.GetIconFromResource("disabled");
            AppData.imageSources[3] = ImageFunctions.GetIconFromResource("notset");

            // Set INIT icon
            this.Dispatcher.Invoke(() =>
            {
                AppData.notifyIcon.IconSource = AppData.imageSources[0];
            });

            // Show Welcome Note
            AppData.notifyIcon.ShowBalloonTip(
                StringsFunctions.ResourceString("resWelcome"),
                StringsFunctions.ResourceString("resVersion"),
                BalloonIcon.Info
                );

            // AdHock
            new RegistryMonitorCore().LoadDataFromRegistry(false);
        }