コード例 #1
0
        internal CommandGroupInfoSpec(CommandGroupInfo info) : base(info.Id)
        {
            Title   = info.Title;
            Tooltip = info.Description;
            Icon    = info.GetCommandIcon();

            if (info.Commands != null)
            {
                Commands = info.Commands.Where(c => c.Triggers.HasFlag(Triggers_e.Button)).Select(
                    c => new CommandItemInfoSpec(c)).ToArray();
            }
            else
            {
                Commands = new CommandItemInfoSpec[0];
            }
        }
コード例 #2
0
        private const int GROUP_ID_OFFSET = 500; //this offset is created to avoid conflicts of toolbar commands with the modules command manager

        internal CommandGroupInfoSpec(CommandGroupInfo info, IIconsProvider[] iconsProviders, IFilePathResolver pathResolver, string workDir) : base(info.Id + GROUP_ID_OFFSET)
        {
            Info = info;

            Title         = info.Title;
            Tooltip       = info.Description;
            RibbonTabName = "Toolbar+";
            Icon          = info.GetCommandIcon(iconsProviders, pathResolver, workDir);

            if (info.Commands != null)
            {
                Commands = info.Commands.Where(c => c.Triggers.HasFlag(Triggers_e.Button)).Select(
                    c => new CommandItemInfoSpec(c, iconsProviders, pathResolver, workDir)).ToArray();
            }
            else
            {
                Commands = new CommandItemInfoSpec[0];
            }
        }
コード例 #3
0
        internal CommandGroupInfoSpec(CommandGroupInfo info, ISldWorks app)
        {
            Id      = info.Id;
            Title   = info.Title;
            Tooltip = info.Description;
            Icon    = info.GetCommandIcon();

            if (info.Commands != null)
            {
                Commands = info.Commands.Where(c => c.Triggers.HasFlag(Triggers_e.Button)).Select(
                    c =>
                {
                    var spec = new CommandItemInfoSpec(c, app);
                    spec.MacroCommandClick += OnMacroCommandClick;
                    return(spec);
                }).ToArray();
            }
            else
            {
                Commands = new CommandItemInfoSpec[0];
            }
        }