Inheritance: System.Attribute
コード例 #1
0
ファイル: SvgElement.cs プロジェクト: tocsoft/SvgSharp
            public PropertyAttributeTuple(PropertyInfo info, SvgAttributeAttribute attribute)
            {
                var typeConverter = info.GetCustomAttribute <TypeConverterAttribute>(true);

                if (typeConverter == null)
                {
                    // property doesn't have one set, use the declaued types converter
                    typeConverter = info.PropertyType.GetTypeInfo().GetCustomAttribute <TypeConverterAttribute>(true);
                }
                this.TypeConverter = typeConverter;
                this.Property      = info;
                this.Attribute     = attribute;
            }
コード例 #2
0
        /// <summary>
        /// When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
        /// </summary>
        /// <param name="obj">An <see cref="T:System.Object"/> to compare with this instance of <see cref="T:System.Attribute"/>.</param>
        /// <returns>
        /// true if this instance equals <paramref name="obj"/>; otherwise, false.
        /// </returns>
        public override bool Match(object obj)
        {
            SvgAttributeAttribute indicator = obj as SvgAttributeAttribute;

            if (indicator == null)
            {
                return(false);
            }

            // Always match if either value is String.Empty (wildcard)
            if (indicator.Name == String.Empty)
            {
                return(false);
            }

            return(String.Compare(indicator.Name, this.Name) == 0);
        }