protected override void ContextClicked() // 右クリックメニュー { base.ContextClicked(); int id = -1; UrlTreeViewItem item = null; if (HasSelection()) { id = GetSelection()[0]; item = (UrlTreeViewItem)GetRows()[id]; } base.ContextClicked(); GenericMenu menu = new GenericMenu(); menu.AddClickItem(ContentMenuOpen, item != null && !string.IsNullOrEmpty(item.Data.URL), () => { System.Diagnostics.Process.Start(item.Data.URL); }); menu.AddClickItem(ContentMenuEdit, item != null, () => { StartEdit(id); }); menu.AddSeparator(""); menu.AddItem(ContentMenuInsert, false, () => { if (item != null) { m_MainWindow.StartInsert(id + 1, new UrlData()); } else { m_MainWindow.StartInsertLast(new UrlData()); } }); menu.AddClickItem(ContentMenuDelete, item != null, () => { m_MainWindow.DeleteAt(id); }); menu.ShowAsContext(); }