Пример #1
0
 private WebCounty GetCounty(Boolean refresh)
 {
     if (_county.IsNull() || refresh)
     {
         _county = GeographicManagerTest.GetOneCounty(GetContext());
     }
     return(_county);
 }
        /// <summary>
        /// Convert a CountyList to a WebCounty array.
        /// </summary>
        /// <param name="counties">The CountyList.</param>
        /// <returns>The WebCounty array.</returns>
        internal static List <WebCounty> GetCounties(CountyList counties)
        {
            County           county;
            Int32            countyIndex;
            WebCounty        webCounty;
            List <WebCounty> webCounties;

            webCounties = null;
            if (counties.IsNotEmpty())
            {
                webCounties = new List <WebCounty>();
                for (countyIndex = 0; countyIndex < counties.Count; countyIndex++)
                {
                    county       = counties[countyIndex];
                    webCounty    = new WebCounty();
                    webCounty.Id = county.Id;
#if DATA_SPECIFIED_EXISTS
                    webCounty.IdSpecified = true;
#endif
                    webCounty.Name              = county.Name;
                    webCounty.Identifier        = county.Identifier;
                    webCounty.IsNumberSpecified = county.HasNumber;
#if DATA_SPECIFIED_EXISTS
                    webCounty.IsNumberSpecifiedSpecified = true;
#endif
                    webCounty.Number       = county.Number;
                    webCounty.IsCountyPart = county.IsCountyPart;
#if DATA_SPECIFIED_EXISTS
                    webCounty.IsCountyPartSpecified = true;
#endif
                    webCounty.PartOfCountyId = county.PartOfCountyId;
#if DATA_SPECIFIED_EXISTS
                    webCounty.PartOfCountyIdSpecified = true;
#endif
                    webCounties.Add(webCounty);
                }
            }
            return(webCounties);
        }
Пример #3
0
 public WebCountyTest()
 {
     _county = null;
 }