System.DateTimeParse.CheckNewValue C# (CSharp) Method

CheckNewValue() private static method

private static CheckNewValue ( int &currentValue, int newValue, char patternChar, DateTimeResult &result ) : bool
currentValue int
newValue int
patternChar char
result DateTimeResult
return bool
        private static bool CheckNewValue(ref int currentValue, int newValue, char patternChar, ref DateTimeResult result) {
            if (currentValue == -1) {
                currentValue = newValue;
                return (true);
            } else {
                if (newValue != currentValue) {
                    result.SetFailure(ParseFailureKind.FormatWithParameter, "Format_RepeatDateTimePattern", patternChar);
                    return (false);
                }
            }
            return (true);
        }