Exemplo n.º 1
0
        /// <summary>
        /// Determines whether the Overridden property of a StepPropertyAttribute is set to true
        /// </summary>
        /// <param name="pi"></param>
        /// <returns></returns>
        private bool IsOverriddenProperty(PropertyInfo pi)
        {
            if (pi == null)
            {
                throw new ArgumentNullException("pi");
            }
            object[] stepPropertyAttributes = pi.GetCustomAttributes(typeof(StepPropertyAttribute), false);
            if (stepPropertyAttributes == null || stepPropertyAttributes.Length < 1)
            {
                return(false);
            }
            StepPropertyAttribute spa = stepPropertyAttributes[0] as StepPropertyAttribute;

            if (spa == null)
            {
                return(false);
            }
            return(spa.Overridden);
        }
Exemplo n.º 2
0
 /// <summary>
 /// </summary>
 /// <param name="pi"></param>
 /// <returns>Returns -1 if no attribute or order number was found</returns>
 private int GetStepPropertyOrderNumber(PropertyInfo pi)
 {
     if (pi == null)
     {
         throw new ArgumentNullException("pi");
     }
     object[] stepPropertyAttributes = pi.GetCustomAttributes(typeof(StepPropertyAttribute), true);
     if (stepPropertyAttributes == null)
     {
         return(-1);
     }
     foreach (object o in stepPropertyAttributes)
     {
         StepPropertyAttribute stepPropAtt = o as StepPropertyAttribute;
         if (stepPropAtt.Order != -1)
         {
             return(stepPropAtt.Order);
         }
     }
     return(-1);
 }