SuperMap.Connector.DataProvider.GetFieldInfos C# (CSharp) Method

GetFieldInfos() public method

public GetFieldInfos ( string datasourceName, string datasetName ) : List
datasourceName string
datasetName string
return List
        public List<FieldInfo> GetFieldInfos(string datasourceName, string datasetName)
        {
#if NET40
            if (string.IsNullOrWhiteSpace(datasourceName))
            {
                throw new ArgumentNullException("datasourceName", Resources.ArgumentIsNotNull);
            }
            if (string.IsNullOrWhiteSpace(datasetName))
            {
                throw new ArgumentNullException("datasetName", Resources.ArgumentIsNotNull);
            }
#else
            if (string.IsNullOrEmpty(datasourceName))
            {
                throw new ArgumentNullException("datasourceName", Resources.ArgumentIsNotNull);
            }
            if (string.IsNullOrEmpty(datasetName))
            {
                throw new ArgumentNullException("datasetName", Resources.ArgumentIsNotNull);
            }
#endif
            string uri = string.Format("{0}/data/datasources/{1}/datasets/{2}/fields.json",
                this._serviceUrl, HttpUtility.UrlEncode(datasourceName), HttpUtility.UrlEncode(datasetName));
            string result = SynchHttpRequest.GetRequestString(uri);
            Dictionary<string, object> hashResult = JsonConvert.DeserializeObject<Dictionary<string, object>>(result);
            if (hashResult != null && hashResult.ContainsKey("fieldNames") && hashResult["fieldNames"] != null)
            {
                string[] fieldNames = JsonConvert.DeserializeObject<string[]>(hashResult["fieldNames"].ToString());
                if (fieldNames != null && fieldNames.Length > 0)
                {
                    List<FieldInfo> fieldInfos = new List<FieldInfo>();
                    for (int i = 0; i < fieldNames.Length; i++)
                    {
                        fieldInfos.Add(GetFieldInfo(datasourceName, datasetName, fieldNames[i]));
                    }
                    return fieldInfos;
                }
            }
            return null;
        }