public void ReplacePopup(string popupType, PopupMenuItem menu) { foreach (PopupMenuItem p in listPopups) { if (p.PopupType == popupType) { listPopups.Remove(p); break; } } listPopups.Add(menu); }
private void UpdateCurrentPopupMenus() { try { string[] popups = ReplaceCharsXml(textPopups.Text).Trim().Split(new String[] { Environment.NewLine }, StringSplitOptions.None);; if (currentPopup == "NickList") { nickListPopup = popups; } if (currentPopup == "Console") { consolePopup = popups; } if (currentPopup == "Channel") { channelPopup = popups; } if (currentPopup == "Query") { queryPopup = popups; } PopupMenuItem p = new PopupMenuItem { PopupType = currentPopup, Menu = popups }; popupList.ReplacePopup(p.PopupType, p); FormMain.Instance.IceChatPopupMenus = popupList; currentPopupMenu.Checked = false; } catch (Exception ex) { FormMain.Instance.WindowMessage(FormMain.Instance.InputPanel.CurrentConnection, "Console", "\x000304UpdatePopupMenus Error:" + ex.Message + ":" + ex.Source, "", true); } }
public void AddPopup(PopupMenuItem menu) { listPopups.Add(menu); }
private void UpdateCurrentPopupMenus() { try { string[] popups = textPopups.Text.Trim().Split(new String[] { Environment.NewLine }, StringSplitOptions.None); if (currentPopup == "NickList") nickListPopup = popups; if (currentPopup == "Console") consolePopup = popups; if (currentPopup == "Channel") channelPopup = popups; if (currentPopup == "Query") queryPopup = popups; PopupMenuItem p = new PopupMenuItem(); p.PopupType = currentPopup; p.Menu = popups; popupList.ReplacePopup(p.PopupType, p); FormMain.Instance.IceChatPopupMenus = popupList; currentPopupMenu.Checked = false; } catch (Exception ex) { FormMain.Instance.WindowMessage(FormMain.Instance.InputPanel.CurrentConnection, "Console", "UpdatePopupMenus Error:" + ex.Message + ":" + ex.Source, 4, true); } }
private PopupMenuItem newPopupMenu(string type, string[] menu) { PopupMenuItem p = new PopupMenuItem(); p.PopupType = type; p.Menu = menu; return p; }