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

MatchEraName() private static méthode

private static MatchEraName ( __DTString &str, DateTimeFormatInfo dtfi, int &result ) : bool
str __DTString
dtfi DateTimeFormatInfo
result int
Résultat bool
        private static bool MatchEraName(ref __DTString str, DateTimeFormatInfo dtfi, ref int result) {
            if (str.GetNext()) {
                int[] eras = dtfi.Calendar.Eras;

                if (eras != null) {
                    for (int i = 0; i < eras.Length; i++) {
                        String searchStr = dtfi.GetEraName(eras[i]);
                        if (str.MatchSpecifiedWord(searchStr)) {
                            str.Index += (searchStr.Length - 1);
                            result = eras[i];
                            return (true);
                        }
                        searchStr = dtfi.GetAbbreviatedEraName(eras[i]);
                        if (str.MatchSpecifiedWord(searchStr)) {
                            str.Index += (searchStr.Length - 1);
                            result = eras[i];
                            return (true);
                        }
                    }
                }
            }
            return false;
        }