コード例 #1
0
        private static IMenuBarButton comparisonNotPossibleMenu(IReadOnlyList <TBuildingBlock> buildingBlocks, IExecutionContext executionContext)
        {
            var buildingBlockType = executionContext.TypeFor(buildingBlocks[0]);

            return(CreateMenuButton.WithCaption(MenuNames.CompareObjects(executionContext.TypeFor(buildingBlocks[0])))
                   .WithIcon(ApplicationIcons.Comparison)
                   .WithActionCommand(() => throw new PKSimException(PKSimConstants.Error.ComparisonBetweenBuildingBLocksNotSupportedForBuildingBlockOfType(buildingBlockType))));
        }
コード例 #2
0
        public static IMenuBarButton CompareObjectsMenu(IReadOnlyList <IObjectBase> objectsToCompare, IReadOnlyList <string> objectNames, IOSPSuiteExecutionContext context)
        {
            if (objectsToCompare.Count != 2)
            {
                return(null);
            }

            if (objectsToCompare.Count != objectNames.Count)
            {
                return(null);
            }

            var menu = CreateMenuButton.WithCaption(MenuNames.CompareObjects(context.TypeFor(objectsToCompare[0])))
                       .WithCommandFor <CompareObjectsUICommand, IReadOnlyList <IObjectBase> >(objectsToCompare)
                       .WithIcon(ApplicationIcons.Comparison);

            var compareObjectCommand = menu.Command.DowncastTo <CompareObjectsUICommand>();

            compareObjectCommand.ObjectNames = objectNames;
            return(menu);
        }