Ejemplo n.º 1
0
        /// <summary>
        /// Assign all classes that are marked with the given attributes (marker attributes).
        /// These attributes have to be an <see cref="IParameterVisualiserInfo"/>.
        /// </summary>
        protected virtual void AssignMarkedClasses(params Type[] markerTypes)
        {
            foreach (Type type in markerTypes)
            {
                // get all classes that have the custom attribute
                IEnumerable <Type> classes = AttributeUtils.GetTypesWithAttribute(type);

                foreach (Type @class in classes)
                {
                    IParameterVisualiserInfo[] visualisers = (IParameterVisualiserInfo[])Attribute.GetCustomAttributes(@class, type);

                    foreach (IParameterVisualiserInfo visualiser in visualisers)
                    {
                        Add(@class, visualiser);
                    }
                }
            }
        }