view ServerMonitor/Attributes.cs @ 23:3866c19535fd

Fix NullReferenceException when checks are executed on a brand new server.
author Brad Greco <brad@bgreco.net>
date Thu, 30 May 2019 21:40:27 -0400
parents 68d7834dc28e
children
line wrap: on
line source

using System;

namespace ServerMonitorApp
{
    /// <summary>
    /// Attribute for use by check controls to indicate
    /// the type of check they correspond to.
    /// </summary>
    internal class CheckTypeAttribute : Attribute
    {
        public Type CheckType { get; private set; }

        public CheckTypeAttribute(Type checkType) { CheckType = checkType; }
    }

    /// <summary>
    /// Attribute for use by checks to determine the order
    /// they appear in the check type selection combo box.
    /// </summary>
    internal class DisplayWeightAttribute : Attribute
    {
        public int DisplayWeight { get; private set; }
        
        public DisplayWeightAttribute(int displayWeight) { DisplayWeight = displayWeight; }
    }
}