示例#1
0
        /// <summary>
        /// Gets the <see cref="Image"/> to decorate the control
        /// </summary>
        /// <param name="ribbonControlId">
        /// The Id property of the associated RibbonControl
        /// </param>
        /// <param name="ribbonControlTag">
        /// The Tag property of the associated RibbonControl
        /// </param>
        /// <returns>
        /// an instance of <see cref="Image"/> that will be used for the association Ribbon Control
        /// </returns>
        public override Image GetImage(string ribbonControlId, string ribbonControlTag = "")
        {
            var converter = new ThingToIconUriConverter();

            switch (ribbonControlId)
            {
            case "ShowMeasurementUnits":
                return(converter.GetImage(ClassKind.MeasurementUnit, false));

            case "ShowMeasurementScales":
                return(converter.GetImage(ClassKind.MeasurementScale, false));

            case "ShowParameterTypes":
                return(converter.GetImage(ClassKind.ParameterType, false));

            case "ShowRules":
                return(converter.GetImage(ClassKind.Rule, false));

            case "ShowCategories":
                return(converter.GetImage(ClassKind.Category, false));

            default:
                return(null);
            }
        }
示例#2
0
        /// <summary>
        /// Gets the <see cref="Image"/> to decorate the control
        /// </summary>
        /// <param name="ribbonControlId">
        /// The Id property of the associated RibbonControl
        /// </param>
        /// <param name="ribbonControlTag">
        /// The Tag property of the associated RibbonControl
        /// </param>
        /// <returns>
        /// an instance of <see cref="Image"/> that will be used for the association Ribbon Control
        /// </returns>
        public override Image GetImage(string ribbonControlId, string ribbonControlTag = "")
        {
            var converter = new ThingToIconUriConverter();

            switch (ribbonControlId)
            {
            case "ShowDomainsOfExpertise":
                return(converter.GetImage(ClassKind.DomainOfExpertise, false));

            case "ShowModels":
                return(converter.GetImage(ClassKind.EngineeringModel, false));

            case "ShowLanguages":
                return(converter.GetImage(ClassKind.NaturalLanguage, false));

            case "ShowOrganizations":
                return(converter.GetImage(ClassKind.Organization, false));

            case "ShowPersons":
                return(converter.GetImage(ClassKind.Person, false));

            case "ShowRoles":
                return(converter.GetImage(ClassKind.PersonRole, false));

            case "ShowSiteRDLs":
                return(converter.GetImage(ClassKind.SiteReferenceDataLibrary, false));

            default:
                return(null);
            }
        }
        /// <summary>
        /// Gets the <see cref="Image"/> to decorate the control
        /// </summary>
        /// <param name="ribbonControlId">
        /// The Id property of the associated RibbonControl
        /// </param>
        /// <param name="ribbonControlTag">
        /// The Tag property of the associated RibbonControl
        /// </param>
        /// <returns>
        /// an instance of <see cref="Image"/> that will be used for the association Ribbon Control
        /// </returns>
        public override Image GetImage(string ribbonControlId, string ribbonControlTag = "")
        {
            var converter = new ThingToIconUriConverter();

            if (ribbonControlId.Contains("ShowRequirements"))
            {
                return(converter.GetImage(ClassKind.RequirementsSpecification, false));
            }

            return(null);
        }
示例#4
0
        public void SetUp()
        {
            this.serviceLocator = new Mock <IServiceLocator>();
            this.serviceLocator.Setup(x => x.GetInstance <IIconCacheService>()).Returns(this.iconCacheService);
            ServiceLocator.SetLocatorProvider(() => this.serviceLocator.Object);

            var ensurePackSchemeIsKnown = System.IO.Packaging.PackUriHelper.UriSchemePack;
            var uri = new Uri("pack://blal");

            this.commonFileStoreIconConverter = new CommonFileStoreIconConverter();
            this.genericConverter             = new ThingToIconUriConverter();
        }
示例#5
0
        /// <summary>
        /// Select node and adds icon to it
        /// </summary>
        /// <param name="rowData"><see cref="TreeListRowData"/></param>
        /// <returns>ImageSource</returns>
        public override ImageSource Select(TreeListRowData rowData)
        {
            var thingStatus = ((IHaveThingStatus)rowData.Row).ThingStatus;

            if (rowData.Row is ParameterOrOverrideBaseRowViewModel parameterOrOverrideBaseRow)
            {
                var productTreeIconConverter = new ProductTreeIconUriConverter();
                var productTreeIcon          = productTreeIconConverter.Convert(new object[] { thingStatus, parameterOrOverrideBaseRow.Usage }, null, null, CultureInfo.InvariantCulture);
                return(productTreeIcon as ImageSource);
            }

            var converter = new ThingToIconUriConverter();
            var icon      = converter.Convert(new object[] { thingStatus }, null, null, CultureInfo.InvariantCulture);

            return(icon as ImageSource);
        }
        /// <summary>
        /// Select node and adds icon to it
        /// </summary>
        /// <param name="rowData"><see cref="TreeListRowData"/></param>
        /// <returns>ImageSource</returns>
        public override ImageSource Select(TreeListRowData rowData)
        {
            var   thingStatus = ((IHaveThingStatus)rowData.Row).ThingStatus;
            Thing thing       = null;

            if (rowData.Row is ParametricConstraintsFolderRowViewModel parametricConstraintsFolderRow)
            {
                thing = parametricConstraintsFolderRow.Thing;
            }
            else if (rowData.Row is ParametricConstraintRowViewModel parametricConstraintRow)
            {
                thing = parametricConstraintRow.Thing;
            }

            var converter = new ThingToIconUriConverter();

            var image = converter.Convert(new object[] { thing, thingStatus }, null, null, CultureInfo.InvariantCulture);

            return(image as ImageSource);
        }