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

MatchAbbreviatedDayName() private static méthode

private static MatchAbbreviatedDayName ( __DTString &str, DateTimeFormatInfo dtfi, int &result ) : bool
str __DTString
dtfi DateTimeFormatInfo
result int
Résultat bool
        private static bool MatchAbbreviatedDayName(ref __DTString str, DateTimeFormatInfo dtfi, ref int result) {
            int maxMatchStrLen = 0;
            result = -1;
            if (str.GetNext()) {
                for (DayOfWeek i = DayOfWeek.Sunday; i <= DayOfWeek.Saturday; i++) {
                    String searchStr = dtfi.GetAbbreviatedDayName(i);
                    int matchStrLen = searchStr.Length;
                    if ( dtfi.HasSpacesInDayNames
                            ? str.MatchSpecifiedWords(searchStr, false, ref matchStrLen)
                            : str.MatchSpecifiedWord(searchStr)) {
                        if (matchStrLen > maxMatchStrLen) {
                            maxMatchStrLen = matchStrLen;
                            result = (int)i;
                        }
                    }
                }
            }
            if (result >= 0) {
                str.Index += maxMatchStrLen - 1;
                return (true);
            }
            return false;
        }