/// <summary> /// マイセット内からアイテムを削除 /// </summary> /// <param name="item">削除するアイテム</param> public void DeleteItem(MysetItem item) { item.icon.control.Dispose(); Items.Remove(item); if (Items.Count <= 0) { MysetManager.DeleteMyset(this); } }
public bool DeleteItem(int idx) { if (0 <= idx && idx < Items.Count) { Items[idx].icon.control.Dispose(); Items.RemoveAt(idx); if (Items.Count <= 0) { MysetManager.DeleteMyset(this); return(true); } } return(false); }
/// <summary> /// マイセット削除 /// </summary> private void MenuItem_DelMyset_Click(object sender, EventArgs e) { MysetManager.DeleteMyset(this); }
private static void DeleteSelectItem() { FormType n = GHManager.GetActiveForm(); if (n == FormType.Launcher) { if (GHManager.Launcher.FormVisible) { int idx = GHManager.Launcher.SelectIndex - 1; if (0 <= idx && idx < GroupManager.Items.Count) { GroupManager.DeleteGroup(GroupManager.Items[idx]); } } } else if (n == FormType.ItemList) { if (GHManager.ItemList.FormVisible) { int select = 0; if (GHManager.ItemList.ParentGHForm == 0) { select = GHManager.Launcher.SelectIndex - 1; if (GroupManager.CheckRange(select)) { GroupManager.Items[select].DeleteItem(GHManager.ItemList.SelectIndex); if (GroupManager.Items[select].Items.Count <= 0) { GHManager.ItemList.HideItemList(); } } } else { select = GHManager.MysetList.SelectIndex; if (MysetManager.CheckRange(select)) { if (MysetManager.Items[select].DeleteItem(GHManager.ItemList.SelectIndex)) { GHManager.ItemList.HideItemList(); if (MysetManager.Items.Count <= 0) { GHManager.MysetList.MysetList_Hide(); } } } } } } else if (n == FormType.MysetList) { if (GHManager.MysetList.FormVisible) { int idx = GHManager.MysetList.SelectIndex; if (MysetManager.CheckRange(idx)) { MysetManager.DeleteMyset(MysetManager.Items[idx]); if (MysetManager.Items.Count <= 0) { GHManager.MysetList.MysetList_Hide(); } } } } }