Location/Location.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ComLib.Entities;


namespace ComLib.LocationSupport
{
    /// <summary>
    /// Static class to provide access to parsing, searching/lookup functionality on cities, states and countries.
    /// </summary>
    public class Location
    {
        private static ILocationService _provider;


        /// <summary>
        /// Initialize with 
        /// </summary>
        /// <param name="service"></param>
        public static void Init(ILocationService service)
        {
            _provider = service;
        }


        /// <summary>
        /// Instance of the location service
        /// </summary>
        public static ILocationService Service
        {
            get { return _provider; }
        }


        #region ILocationService Members
        /// <summary>
        /// Does a high-level check of the format supplied and determines what type
        /// of location input was supplied.
        /// 
        /// Formats are:
        /// 1. city                         - "Bronx"
        /// 2. city,state                   - "Bronx , New York"
        /// 3. city,state( abbreviation )   - "Bronx , NY"
        /// 4. city,country                 - "HomeTown , USA"
        /// 5. state                        - "New Jersey"
        /// 6. state abbreviation           - "NJ"
        /// 7. country                      - "Italy"
        /// the actuall parsing 
        /// </summary>
        /// <param name="text">Text representing the location.</param>
        /// <returns></returns>
        public static LocationLookUpResult Parse(string text)
        {
            return _provider.Parse(text);
        }


后面还有 141 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。