/// <summary> /// 区域信息转化 /// </summary> /// <returns>区域信息</returns> internal AreaInformation ToAreaInformation() { CodeNameMapping province = this.TopParent.Info; CodeNameMapping city = default(CodeNameMapping); CodeNameMapping county = default(CodeNameMapping); if (this.Parent != null) { if (this.Parent.Info == province) { city = this.Info; } else { city = this.Parent.Info; county = this.Info; } } return(new AreaInformation(province, city, county)); }
/// <summary> /// Initializes a new instance of the <see cref="AreaInformation"/> class. /// </summary> /// <param name="province">省</param> /// <param name="city">市</param> /// <param name="county">区</param> public AreaInformation(CodeNameMapping province, CodeNameMapping city, CodeNameMapping county) { this.Province = province; this.City = city; this.County = county; }