예제 #1
0
        private NameValueCollection GetArguments(string placeId)
        {
            var args = new NameValueCollection();

            args.Set("geo", IncludeCoordinates.ToNum());
            args.Set("lang", Language);
            args.Set("radius", Radius.ToString());
            args.Set("sun", IncludeSunriseAndSunset.ToNum());
            args.Set("time", IncludeCurrentTimeToLocation.ToNum());
            args.Set("timechanges", IncludeListOfTimeChanges.ToNum());
            args.Set("tz", IncludeTimezoneInformation.ToNum());
            args.Set("placeid", placeId);
            args.Set("verbosetime", Constants.DefaultVerboseTimeValue.ToString());

            return(args);
        }
예제 #2
0
        private NameValueCollection GetOptionalArguments()
        {
            var args = new NameValueCollection();

            args.Set("locinfo", IncludeLocations.ToNum());
            args.Set("geo", IncludeCoordinates.ToNum());
            args.Set("time", IncludeCurrentTime.ToNum());
            args.Set("tz", IncludeTimezoneInformation.ToNum());
            args.Set("verbosetime", Constants.DefaultVerboseTimeValue.ToString());

            if (_number.HasValue)
            {
                args.Set("number", _number.Value.ToString());
            }

            return(args);
        }
예제 #3
0
        private NameValueCollection GetOptionalArguments()
        {
            var optionalArgs = new NameValueCollection();
            var types        = GetAstronomyEventTypes();

            optionalArgs.Set("geo", IncludeCoordinates.ToNum());
            optionalArgs.Set("isotime", IncludeISOTime.ToNum());
            optionalArgs.Set("lang", Language);
            optionalArgs.Set("radius", Radius.ToString());
            optionalArgs.Set("utctime", IncludeUTCTime.ToNum());
            optionalArgs.Set("verbosetime", Constants.DefaultVerboseTimeValue.ToString());

            if (!string.IsNullOrEmpty(types))
            {
                optionalArgs.Set("types", types);
            }

            return(optionalArgs);
        }