System.Net.WebProxyScriptHelper.WebProxyScriptHelper.weekdayRange C# (CSharp) Method

weekdayRange() public method

public weekdayRange ( string wd1, [ wd2, [ gmt ) : bool
wd1 string
wd2 [
gmt [
return bool
        public bool weekdayRange(string wd1, [Optional] object wd2, [Optional] object gmt)
        {
            GlobalLog.Print("WebProxyScriptHelper::weekdayRange() wd1:" + ValidationHelper.ToString(wd1) + " wd2:" + ValidationHelper.ToString(wd2) + " gmt:" + ValidationHelper.ToString(gmt));
            if (wd1 == null)
            {
                if(Logging.On)Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_called_with_null_parameter, "WebProxyScriptHelper.weekdayRange()", "wd1"));
                throw new ArgumentNullException("wd1");
            }
            string _gmt = null;
            string _wd2 = null;
            if (gmt != null && gmt != DBNull.Value && gmt != Missing.Value)
            {
                _gmt = gmt as string;
                if (_gmt == null)
                {
                    throw new ArgumentException(SR.GetString(SR.net_param_not_string, gmt.GetType().FullName), "gmt");
                }
            }
            if (wd2 != null && wd2 != DBNull.Value && gmt != Missing.Value)
            {
                _wd2 = wd2 as string;
                if (_wd2 == null)
                {
                    throw new ArgumentException(SR.GetString(SR.net_param_not_string, wd2.GetType().FullName), "wd2");
                }
            }
            if (_gmt != null)
            {
                if (!isGMT(_gmt))
                {
                    if(Logging.On)Logging.PrintWarning(Logging.Web, SR.GetString(SR.net_log_proxy_called_with_null_parameter, "WebProxyScriptHelper.weekdayRange()", "gmt"));
                    throw new ArgumentException(SR.GetString(SR.net_proxy_not_gmt), "gmt");
                }
                return weekdayRangeInternal(DateTime.UtcNow, dayOfWeek(wd1), dayOfWeek(_wd2));
            }
            if (_wd2 != null)
            {
                if (isGMT(_wd2))
                {
                    return weekdayRangeInternal(DateTime.UtcNow, dayOfWeek(wd1), dayOfWeek(wd1));
                }
                return weekdayRangeInternal(DateTime.Now, dayOfWeek(wd1), dayOfWeek(_wd2));
            }
            return weekdayRangeInternal(DateTime.Now, dayOfWeek(wd1), dayOfWeek(wd1));
        }