// Constructor
        public ErrorCheckForm()
        {
            // Initialize
            InitializeComponent();

            // Find all error checkers
            Type[] checkertypes = BuilderPlug.Me.FindClasses(typeof(ErrorChecker));
            foreach (Type t in checkertypes)
            {
                object[] attr = t.GetCustomAttributes(typeof(ErrorCheckerAttribute), true);
                if (attr.Length > 0)
                {
                    ErrorCheckerAttribute checkerattr = (attr[0] as ErrorCheckerAttribute);

                    // Add the type to the checkbox list
                    CheckBox c = checks.Add(checkerattr.DisplayName, t);
                    c.Checked = checkerattr.DefaultChecked;
                }
            }
        }
Пример #2
0
 // Constructor
 // Override this to determine and set the total progress
 public ErrorChecker()
 {
     // Initialize
     object[] attrs = this.GetType().GetCustomAttributes(typeof(ErrorCheckerAttribute), true);
     attribs = (ErrorCheckerAttribute)attrs[0];
 }