示例#1
0
 private void ClearSlot(NotifyWidget n)
 {
     var index = slots.IndexOf(n);
     if (index != -1)
     {
         parentForm.Controls.Remove(n);
         slots[index] = null;
     }
 }
示例#2
0
        private void ClearSlot(NotifyWidget n)
        {
            var index = slots.IndexOf(n);

            if (index != -1)
            {
                parentForm.Controls.Remove(n);
                slots[index] = null;
            }
        }
示例#3
0
        private void Show(NotifyWidget n)
        {
            if (appConfigManager.Config.DisableSaveNotifications)
            {
                return;
            }

            int slot = FillNextSlot(n);

            n.Location = GetPosition(n, slot);
            n.BringToFront();
            n.HideNotify += (sender, args) => ClearSlot(n);
            n.ShowNotify();
        }
示例#4
0
 private int FillNextSlot(NotifyWidget n)
 {
     var index = slots.IndexOf(null);
     if (index == -1)
     {
         index = slots.Count;
         slots.Add(n);
     }
     else
     {
         slots[index] = n;
     }
     parentForm.Controls.Add(n);
     return index;
 }
示例#5
0
        private int FillNextSlot(NotifyWidget n)
        {
            var index = slots.IndexOf(null);

            if (index == -1)
            {
                index = slots.Count;
                slots.Add(n);
            }
            else
            {
                slots[index] = n;
            }
            parentForm.Controls.Add(n);
            return(index);
        }
示例#6
0
 private Point GetPosition(NotifyWidget n, int slot)
 {
     return(new Point(parentForm.ClientSize.Width - n.Width - PADDING_X,
                      parentForm.ClientSize.Height - n.Height - PADDING_Y - (n.Height + SPACING_Y) * slot));
 }
示例#7
0
        private void Show(NotifyWidget n)
        {
            if (appConfigManager.Config.DisableSaveNotifications)
            {
                return;
            }

            int slot = FillNextSlot(n);
            n.Location = GetPosition(n, slot);
            n.BringToFront();
            n.HideNotify += (sender, args) => ClearSlot(n);
            n.ShowNotify();
        }
示例#8
0
 private Point GetPosition(NotifyWidget n, int slot)
 {
     return new Point(parentForm.ClientSize.Width - n.Width - PADDING_X,
         parentForm.ClientSize.Height - n.Height - PADDING_Y - (n.Height + SPACING_Y) * slot);
 }