private void SetReferenceDateFromStringPassed(string referenceDatePassed)
 {
     if (referenceDatePassed == null)
     {
         FormattingError newError = new FormattingError(FormattingErrorTypes.Null);
         errors.Add(newError);
     }
     else if (referenceDatePassed.Length == 0)
     {
         FormattingError newError = new FormattingError(FormattingErrorTypes.Empty);
         errors.Add(newError);
     }
     else if (!DateIsValid(referenceDatePassed))
     {
         FormattingError newError = new FormattingError(FormattingErrorTypes.FailedParse);
         errors.Add(newError);
     }
 }
 private bool ConvertTextToBoolean()
 {
     bool result = false;
     switch (Text.ToUpper())
     {
         case "0":
             result = false;
             break;
         case "FALSE":
             result = false;
             break;
         case "1":
             result = true;
             break;
         case "TRUE":
             result = true;
             break;
         default:
             FormattingError newError = new FormattingError(FormattingErrorTypes.FailedParse);
             newError.Name = Name;
             errors.Add(newError);
             break;
     }
     return result;
 }
 private void SetReferenceDateFromDateTimePassed(DateTime referenceDatePassed)
 {
     if (referenceDatePassed != null)
     {
         referenceDate = referenceDatePassed;
     }
     else
     {
         FormattingError newError = new FormattingError(FormattingErrorTypes.Null);
         errors.Add(newError);
     }
 }
        private int ConvertTextToInteger()
        {
            int result = 0;
            if (!Int32.TryParse(Text, out result))
            {
                FormattingError newError = new FormattingError(FormattingErrorTypes.FailedParse);
                newError.Name = Name;
                errors.Add(newError);
            }

            return result;
        }