_Samples/Example_Location.cs

(开头部分) 4KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data;
using System.Data.Common;
using System.Security.Cryptography;


using ComLib;
using ComLib.Application;
using ComLib.Entities;
using ComLib.Extensions;
using ComLib.LocationSupport;


namespace ComLib.Samples
{
    /// <summary>
    /// Example for the LocationSupport namespace.
    /// </summary>
    public class Example_Location : App
    {

        /// <summary>
        /// Run the application.
        /// </summary>
        public override BoolMessageItem Execute()
        {
            // Example 1:
            // This actually parses the location names and looks it up the various repositories.
            // This is typically what's entered into the location text box for sites like 
            // yelp, eventful, upcoming.org.

            Print(Location.Parse("brooklyn"));
            Print(Location.Parse("miami,Florida"));
            Print(Location.Parse("new jersey"));
            Print(Location.Parse("bronx"));
            Print(Location.Parse("bronx,new york"));
            Print(Location.Parse("bronx,connecticut"));
            Print(Location.Parse("venice,italy"));
            Print(Location.Parse("venice,united states"));

            // Example 2:
            // Get all the countries
            IList<Country> countries = Location.Countries.GetAll();
            
            // Example 3:
            // Get all the states for a specific country.
            IList<State> unitedStates = Location.StatesFor("USA").Item;

            // Example 4:
            // Get all the cities for a specific state, country combination.
            IList<City> citiesInNewYork = Location.CitiesFor("USA", "New York").Item;

            // Example 5:
            // Get a country lookup which can be lookup countries by both Id and Name.
            CountryLookUp countriesLookup = Location.CountriesLookup;

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

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

AI 解读

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

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