Example #1
0
        private void DeviceList_ItemsAdding(object sender, ItemsAddingEventArgs e)
        {
            if (DeviceList.Items.Count >= 8 && !ResizeDone)
            {
                olvColumn7.MaximumWidth = 83;
                olvColumn7.MinimumWidth = 83;
                olvColumn7.Width        = 83;
                ResizeDone = true;
            }

            //Notifications are not suppressed
            if (WindowState == FormWindowState.Minimized && Properties.Settings.Default.SuppressNotifications == 2)
            {
                var Ad = e.ObjectsToAdd.Cast <Device>().ToList();
                if (Ad.Count > 0)
                {
                    Device Device = Ad[0];

                    ToastAPI.ShowPrompt(string.Format("{0}\nIP:{1}\nMAC:{2}",
                                                      Properties.Resources.NewTargetNotificationPrompt,
                                                      Device.IP,
                                                      Device.MAC), NotificationPurpose.TargetDiscovery, Device.IP.ToString(), Device.MAC.ToString());
                }
            }
        }
Example #2
0
        public void Main_Resize(object sender, EventArgs e)
        {
            if (WindowState == FormWindowState.Minimized)
            {
                if (Properties.Settings.Default.Minimize == "Tray")
                {
                    Hide();
                    TrayIcon.Visible = true;
                    TrayIcon.ShowBalloonTip(2);
                }

                if (Properties.Settings.Default.SuppressNotifications == 0)
                {
                    ToastAPI.ShowPrompt(Properties.Resources.NotificationsPrompt, NotificationPurpose.NotificationsSuppression);
                }
            }
        }