public static async Task <string> MakeCall(this string input, LocateType type) { string googleType = ""; switch (type) { case LocateType.Country: googleType = "(regions)"; break; case LocateType.City: googleType = "(cities)"; break; case LocateType.Address: googleType = "address"; break; } // new Uri( //$"https://maps.googleapis.com/maps/api/geocode/json?latlng={lat},{lng}{ConstValues.GoogleLocateKey}&language=en"); var uri = new Uri($"{ConstValues.GoogleLocateBase}{input}&types={googleType}{ConstValues.GoogleLocateKey}&language=ar"); using (var client = new HttpClient()) { var resp = await client.GetAsync(uri); return(await resp.Content.ReadAsStringAsync()); } }
/// <summary> /// 转译为对应数据库的查询语句 /// </summary> public static string ToQueryString(this LocateType operatorType) { switch (operatorType) { case LocateType.Equal: return("="); case LocateType.NotEqual: return("!="); case LocateType.In: return("in"); case LocateType.NotIn: return("not in"); case LocateType.GreatThan: return(">"); case LocateType.LessThan: return("<"); case LocateType.EqualOrGreatThan: return(">="); case LocateType.EqualOrLessThan: return("<="); default: throw new NotImplementedException("未支持该类型的操作符" + operatorType.ToString()); } }
public ComponentValueOfWhere(List <PDMDbProperty> Properties, object value, LocateType operatorType, string nickName) { this.Properties = Properties; this.IsMultipleProperties = true; this.Operator = operatorType; this.Value = value; this.NickName = nickName; }
public ComponentValueOfWhere(PDMDbProperty property, object value, LocateType operatorType, string nickName = null) { this.Property = property; this.IsMultipleProperties = false; this.Operator = operatorType; this.Value = value; this.NickName = !string.IsNullOrEmpty(nickName) ? nickName : property.Title; }
/// <summary> /// 通过定位类型获取父物体 /// </summary> /// <param name="locate"></param> /// <returns></returns> public Transform getUIParent(LocateType locate) { if (UIParent.Count == 0) { UIParent = UIParentDicInit(); //UI元素父节点transform信息初始化/ } return(UIParent[locate]); }
/// <summary> /// 新增条件项 /// </summary> public void Add(List <PDMDbProperty> Properties, object value, LocateType operatorType, string nickName) { Wheres.Add(new ComponentValueOfWhere(Properties, value, operatorType, nickName)); }
/// <summary> /// 新增条件项 /// </summary> public void Add(PDMDbProperty property, object value, LocateType operatorType, string nickName = null) { Wheres.Add(new ComponentValueOfWhere(property, value, operatorType, nickName)); }
/// <summary> /// 新增条件项 /// </summary> public void Add(PDMDbProperty property, SelectBuilder subSelect, LocateType operatorType, string nickName = null) { Wheres.Add(new ComponentValueOfWhere(property, subSelect, operatorType, nickName)); }
public ComponentValueOfWhere(PDMDbProperty property, SelectBuilder subSelect, LocateType operatorType, string nickName = null) { this.Property = property; this.IsMultipleProperties = false; this.Operator = operatorType; this.SubSelect = subSelect; this.NickName = !string.IsNullOrEmpty(nickName) ? nickName : property.Title; }
public Orientation(LocateType type, Vector3 localPos) { this.type = type; this.localPos = localPos; }