private void ClearSlot(NotifyWidget n) { var index = slots.IndexOf(n); if (index != -1) { parentForm.Controls.Remove(n); slots[index] = null; } }
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(); }
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; }
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); }
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)); }
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); }