Example #1
0
        static void _callerQ_Load_Notify(object sender, EventArgs e)
        {
            SortableList <CallRecord> overdueItems = new SortableList <CallRecord>();

            foreach (CallRecord record in Settings.Default.Queue)
            {
                if (record.NotifyDate < DateTime.Now.AddMinutes(2) && !record.WasNotified && record.IsActive)
                {
                    overdueItems.Add(record);
                }
            }

            if (overdueItems.Count > 0)
            {
                overdueItems.Sort("NotifyDate", System.ComponentModel.ListSortDirection.Ascending);

                foreach (CallRecord record in overdueItems)
                {
                    using (Notifier notifier = new Notifier())
                    {
                        notifier.ShowDialog(record);
                    }
                }
            }
            Settings.Save();
            SetNotification();
        }
Example #2
0
        public OwnerDrawnListBox()
        {
            this.vs               = new VScrollBar();
            this.vs.Parent        = this;
            this.vs.Visible       = false;
            this.vs.SmallChange   = 1;
            this.vs.ValueChanged += new EventHandler(this.ScrollValueChanged);

            this.items              = new SortableList <T>();
            this.items.ListChanged += new ListChangedEventHandler(items_ListChanged);
            this.filteredItems      = new SortableList <T>();

            if (null == _groupingFont)
            {
                _groupingFont = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold);
            }
            using (Graphics g = Graphics.FromImage(GroupingBar))
            {
                _groupHeight = (int)Math.Ceiling(g.MeasureString("A", _groupingFont).Height * 1.5);
            }
        }