_group = CounterGroup.GetCounterGroup(eventSource);
_group.Add(this);
Name = name;
+ DisplayUnits = string.Empty;
EventSource = eventSource;
}
}
}
- public string? DisplayName { get; set; }
+ private string _displayName = "";
+ public string DisplayName
+ {
+ set
+ {
+ if (value == null)
+ throw new ArgumentException("Cannot set null as DisplayName");
+ _displayName = value;
+ }
+ get { return _displayName; }
+ }
- public string? DisplayUnits { get; set; }
+ private string _displayUnits = "";
+ public string DisplayUnits
+ {
+ set
+ {
+ if (value == null)
+ throw new ArgumentException("Cannot set null as DisplayUnits");
+ _displayUnits = value;
+ }
+ get { return _displayUnits; }
+ }
public string Name { get; }