private HidPowerPhysicalUnit(string name, string physUnit, string hidUnit, HidPowerPhysicalUnitCode unitCode, int exp, int fieldSize) { Name = name; PhysicalUnit = physUnit; HIDUnit = hidUnit; Code = unitCode; Exponent = exp; FieldSize = fieldSize; var res = units.Where((o) => o.Name == name).FirstOrDefault(); if (res == null) { units.Add(this); } }
public static HidPowerPhysicalUnit GetByCode(HidPowerPhysicalUnitCode code) { return(units.Where((o) => o.Code == code).FirstOrDefault()); }