Пример #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);
        }