コード例 #1
0
ファイル: RequestBlocks.cs プロジェクト: adi97ida/SchoolProj
        public static string PrepareQueryParameter(this GetBy getby, string value)
        {
            string queryParameter = "";

            switch (getby)
            {
            case GetBy.CityName:
                queryParameter = ReqestFor.City(value);
                break;

            case GetBy.Zip:
                queryParameter = ReqestFor.Zip(value);
                break;

            case GetBy.PostCode:
                queryParameter = ReqestFor.PostCode(value);
                break;

            case GetBy.PostalCode:
                queryParameter = ReqestFor.PostalCode(value);
                break;

            case GetBy.Metar:
                queryParameter = ReqestFor.Metar(value);
                break;

            case GetBy.iata:
                queryParameter = ReqestFor.iata(value);
                break;

            case GetBy.IPAddress:
                queryParameter = ReqestFor.IPAddress(value);
                break;
            }
            return(queryParameter);
        }
コード例 #2
0
 public static string PrepareRequestByAutoIP(MethodType methodType, string key, DateTime date)
 {
     return(string.Concat(methodType.GetParameters(), "?key=", key, "&", ReqestFor.AutoIP(), "&", ReqestFor.Date(date)));
 }
コード例 #3
0
 public static string PrepareRequestByAutoIP(MethodType methodType, string key, Days ofDays)
 {
     return(string.Concat(methodType.GetParameters(), "?key=", key, "&", ReqestFor.AutoIP(), "&", ofDays.PrepareDays()));
 }
コード例 #4
0
 public static string PrepareRequestByLatLong(MethodType methodType, string key, string latitude, string longitude, DateTime date)
 {
     return(string.Concat(methodType.GetParameters(), "?key=", key, "&", ReqestFor.LatLong(latitude, longitude), "&", ReqestFor.Date(date)));
 }
コード例 #5
0
 public static string PrepareRequest(MethodType methodType, string key, GetBy getBy, string value, DateTime date)
 {
     return(string.Concat(methodType.GetParameters(), "?key=", key, "&", getBy.PrepareQueryParameter(value), "&", ReqestFor.Date(date)));
 }