Example #1
0
        private void InitializeTrayIcon()
        {
            TrayIcon = new TrayIndicator
            {
                Title   = "Titan",
                Icon    = SharedResources.TITAN_ICON,
                Visible = true
            };

            TrayIcon.SetMenu(new ContextMenu
            {
                Items =
                {
                    new Command((sender, args) => ShowForm(UIType.General))
                    {
                        MenuText = "Show"
                    },
                    new Command((sender, args) => Environment.Exit(0))
                    {
                        MenuText = "Exit"
                    }
                }
            });

            GetForm <General.General>(UIType.General).Closing += (sender, args) =>
            {
                HideForm(UIType.General);

                SendNotification("Titan", "Titan will continue to run in the background " +
                                 "and will notify you as soon as a victim got banned.",
                                 () => ShowForm(UIType.General));

                args.Cancel = true;
            };
        }