Example #1
0
        /// <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);
            }
                );
        }
Example #2
0
        /// <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);
            }
                );
        }