System.DateTimeParse.AdjustTimeMark C# (CSharp) Méthode

AdjustTimeMark() private static méthode

private static AdjustTimeMark ( DateTimeFormatInfo dtfi, DateTimeRawInfo &raw ) : void
dtfi System.Globalization.DateTimeFormatInfo
raw DateTimeRawInfo
Résultat void
        private static void AdjustTimeMark(DateTimeFormatInfo dtfi, ref DateTimeRawInfo raw) {
            // Specail case for culture which uses AM as empty string.
            // E.g. af-ZA (0x0436)
            //    S1159                  \x0000
            //    S2359                  nm
            // In this case, if we are parsing a string like "2005/09/14 12:23", we will assume this is in AM.

            if (raw.timeMark == TM.NotSet) {
                if (dtfi.AMDesignator != null && dtfi.PMDesignator != null) {
                    if (dtfi.AMDesignator.Length == 0 && dtfi.PMDesignator.Length != 0) {
                        raw.timeMark = TM.AM;
                    }
                    if (dtfi.PMDesignator.Length == 0 && dtfi.AMDesignator.Length != 0) {
                        raw.timeMark = TM.PM;
                    }
                }
            }
        }