/// <summary> /// グループの下にグループを作成する /// </summary> /// <param name="node">親のグループ</param> /// <param name="name">グループ名</param> /// <returns>作成したグループ</returns> public static TreeMenuNode CreateGroup(TreeMenuNode node, string name) { var newNode = new TreeMenuNode(name); node.AddChild(newNode); return(newNode); }
/// <summary> /// グループにアセットを登録する /// </summary> /// <param name="group">登録するグループ</param> /// <param name="funcAssetDef">アセット</param> protected static void CreateAssetMenu(CommandCanvas OwnerCommandCanvas, TreeMenuNode group, IFuncCreateAssetDef funcAssetDef) { AddAsset(funcAssetDef); string title = TreeViewCommand.MakeGroup(ref group, funcAssetDef.MenuTitle); var menu = new TreeMenuNode(title, funcAssetDef.HelpText); group.AddChild(menu); menu.LeftClickCommand = OwnerCommandCanvas.CreateEventCanvasCommand( menu.Path, () => { var result = CbScript.CreateFunction(OwnerCommandCanvas, funcAssetDef.AssetCode); if (funcAssetDef.MenuTitle.Contains(CbSTUtils.MENU_OLD_SPECIFICATION)) { result.OldSpecification = true; } return(result); } ); }
/// <summary> /// グループにアセットを登録する /// </summary> /// <param name="group">登録するグループ</param> /// <param name="funcAssetDef">アセット</param> public static void CreateAssetMenu(CommandCanvas OwnerCommandCanvas, TreeMenuNode group, IFuncAssetLiteralDef funcAssetDef) { //AddAsset(funcAssetDef); 不要 string title = TreeViewCommand.MakeGroup(ref group, funcAssetDef.MenuTitle); var menu = new TreeMenuNode(title, funcAssetDef.HelpText); group.AddChild(menu); menu.LeftClickCommand = OwnerCommandCanvas.CreateEventCanvasCommand( menu.Path, () => { var result = CbScript.SelectVariableType(OwnerCommandCanvas, funcAssetDef.typeRequests); if (funcAssetDef.MenuTitle.Contains(CbSTUtils.MENU_OLD_SPECIFICATION)) { result.OldSpecification = true; } return(result); } ); }