Click here to Skip to main content
15,879,239 members
Articles / Programming Languages / C#

GeoNames .NET WCF Client

Rate me:
Please Sign up or sign in to vote.
4.40/5 (16 votes)
21 Apr 2009MIT3 min read 203.9K   3K   59  
A .NET WCF client for accessing the GeoNames services
#region Header
/////////////////////////////////////////////////////////////////////////////
//
// Myren.GeoNames.Client.GeoWikipediaArticle
//
//
// Authors: 
//   Dennis Myren
//   
//
/////////////////////////////////////////////////////////////////////////////
// 
// Copyright (c) 2008 Dennis Myren
// 
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
///////////////////////////////////////////////////////////////////////////////
#endregion // Header


using System.Runtime.Serialization;


namespace Myren.GeoNames.Client
{

  /// <summary>
  /// Defines a GeoNames Wikipedia article data contract.
  /// </summary>
  [DataContract]
  public sealed class GeoWikipediaArticle
  {

    /// <summary>
    /// Creates a new instance of GeoWikipediaArticle.
    /// </summary>
    public GeoWikipediaArticle ( )
    {
    }


    /// <summary>
    /// Gets the language used in this Wikipedia article.
    /// </summary>
    public string Culture
    {
      get
      {
        return _culture;
      }
    }
    [DataMember ( Name = "lang" )]
    private string _culture = null;

    /// <summary>
    /// Gets a code that identifies the country.
    /// </summary>
    public string CountryCode
    {
      get
      {
        return _countryCode;
      }
    }
    [DataMember ( Name = "countryCode" )]
    private string _countryCode = null;

    /// <summary>
    /// Gets the title of the article.
    /// </summary>
    public string Title
    {
      get
      {
        return _title;
      }
    }
    [DataMember ( Name = "title" )]
    private string _title = null;

    /// <summary>
    /// Gets the Wikipedia summary.
    /// </summary>
    public string Summary
    {
      get
      {
        return _summary;
      }
    }
    [DataMember ( Name = "summary" )]
    private string _summary = null;

    /// <summary>
    /// Gets the Wikipedia URL.
    /// </summary>
    public string WikipediaUrl
    {
      get
      {
        return _wikipediaUrl;
      }
    }
    [DataMember ( Name = "wikipediaUrl" )]
    private string _wikipediaUrl = null;

    /// <summary>
    /// Gets an URL to a thumbnail image associated with this article.
    /// </summary>
    public string ThumbnailImageUrl
    {
      get
      {
        return _thumbnailImageUrl;
      }
    }
    [DataMember ( Name = "thumbnailImg" )]
    private string _thumbnailImageUrl = null;

    /// <summary>
    /// </summary>
    public string Feature
    {
      get
      {
        return _feature;
      }
    }
    [DataMember ( Name = "feature" )]
    private string _feature = null;

    /// <summary>
    /// Gets the population information for this place.
    /// </summary>
    public long Population
    {
      get
      {
        return _population;
      }
    }
    [DataMember ( Name = "population" )]
    private long _population = 0;

    /// <summary>
    /// Gets the elevation.
    /// </summary>
    public double Elevation
    {
      get
      {
        return _elevation;
      }
    }
    [DataMember ( Name = "elevation" )]
    private double _elevation = 0;

    /// <summary>
    /// Gets the latitude.
    /// </summary>
    public double Latitude
    {
      get
      {
        return _lat;
      }
    }
    [DataMember ( Name = "lat" )]
    private double _lat = 0;

    /// <summary>
    /// Gets the longitude.
    /// </summary>
    public double Longitude
    {
      get
      {
        return _long;
      }
    }
    [DataMember ( Name = "lng" )]
    private double _long = 0;

    /// <summary>
    /// Gets the distance.
    /// </summary>
    public double Distance
    {
      get
      {
        return _distance;
      }
    }
    [DataMember ( Name = "distance" )]
    private double _distance = 0;


  }


}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer (Senior)
Norway Norway
Software Engineer at FAST, a Microsoft Subsidiary, in Oslo, Norway. Background in C++/PASCAL. Specialized in .NET and XML.

Comments and Discussions