private UiContextMenu CreateTreeViewContextMenu() { UiContextMenu menu = UiContextMenuFactory.Create(); { menu.AddChild(UiMenuItemFactory.Create(Lang.Dockable.GameFileCommander.Unpack, new UiGameFileCommanderExtractCommand(() => _treeNodes))); menu.AddChild(UiMenuItemFactory.Create(Lang.Dockable.GameFileCommander.Pack, new UiGameFileCommanderInjectCommand(() => _treeNodes))); } return(menu); }
public static UiDataProviderNode Create <T>(InfoProviderGroup <T> providers) where T : class { UiContextMenu menu = UiContextMenuFactory.Create(); for (int index = 0; index < providers.Count; index++) { IInfoProvider <T> provider = providers[index]; UiMenuItem menuItem = UiMenuItemFactory.Create(provider.Title, new UiDataProviderNodeRefreshCommand(() => providers.Refresh(provider))); menuItem.ToolTip = provider.Description; menu.AddChild(menuItem); } UiDataProviderNode node = new UiDataProviderNode(providers.Title, providers.Description, menu); providers.InfoLost += node.OnInfoLost; providers.InfoProvided += node.OnInfoProvided; return(node); }