BlogEngine.Core.Web.HttpModules.UrlRewrite.ExtractDate C# (CSharp) 메소드

ExtractDate() 개인적인 정적인 메소드

Extracts the year and month from the requested URL and returns that as a DateTime.
private static ExtractDate ( HttpContext context, int &year, int &month, int &day ) : bool
context System.Web.HttpContext /// The context. ///
year int /// The year number. ///
month int /// The month number. ///
day int /// The day number. ///
리턴 bool
        private static bool ExtractDate(HttpContext context, out int year, out int month, out int day)
        {
            year = 0;
            month = 0;
            day = 0;

            if (!BlogSettings.Instance.TimeStampPostLinks) {
                return false;
            }

            var match = YearMonthDayRegex.Match(GetUrlWithQueryString(context));
            if (match.Success) {
                year = int.Parse(match.Groups[1].Value, CultureInfo.InvariantCulture);
                month = int.Parse(match.Groups[2].Value, CultureInfo.InvariantCulture);
                day = int.Parse(match.Groups[3].Value, CultureInfo.InvariantCulture);
                return true;
            }

            match = YearMonthRegex.Match(GetUrlWithQueryString(context));
            if (match.Success) {
                year = int.Parse(match.Groups[1].Value, CultureInfo.InvariantCulture);
                month = int.Parse(match.Groups[2].Value, CultureInfo.InvariantCulture);
                return true;
            }

            return false;
        }