Beispiel #1
0
        /// <summary>
        /// Gets the quality band associated with a member of a class
        /// </summary>
        /// <param name="mi">Member info</param>
        public static QualityBand GetQualityBand(MemberInfo mi)
        {
            if (mi == null)
            {
                return(QualityBand.Unknown);
            }
            QualityBand ownerQB = GetQualityBand(mi.ReflectedType);

            Quality[]   qatts    = (Quality[])mi.GetCustomAttributes(typeof(Quality), true);
            QualityBand memberQB = QualityBand.Unknown;

            if (qatts != null && qatts.Length > 0)
            {
                memberQB = qatts[0].Band;
            }

            if (memberQB == QualityBand.Unknown)
            {
                return(ownerQB);
            }
            else
            {
                return(memberQB);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets the quality band associated with a type. If this is an array type
        /// then the quality of the element is returned. If the type has generic parameters
        /// then the quality of the generic type is returned
        /// </summary>
        /// <param name="t">Type</param>
        public static QualityBand GetQualityBand(Type t)
        {
            if (t.IsArray)
            {
                return(GetQualityBand(t.GetElementType()));
            }

            if (t.IsGenericType)
            {
                t = t.GetGenericTypeDefinition();
            }

            QualityBand qb = QualityBand.Unknown;

            Quality[] qatts = (Quality[])t.GetCustomAttributes(typeof(Quality), true);
            if (qatts != null && qatts.Length > 0)
            {
                qb = qatts[0].Band;
            }
            return(qb);
        }
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="band"></param>
		public Quality(QualityBand band)
		{
			Band = band;
		}
Beispiel #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="band"></param>
 public Quality(QualityBand band)
 {
     Band = band;
 }
Beispiel #5
0
 public QualityBandCompilerAttribute(QualityBand qualityBand)
 {
     this.QualityBand = qualityBand;
 }