XAML-Map-Control/MapControl/Shared/LocationCollection.cs

38 lines
971 B
C#
Raw Normal View History

// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
// © 2018 Clemens Fischer
2012-07-07 17:19:10 +02:00
// Licensed under the Microsoft Public License (Ms-PL)
using System;
2012-05-04 12:52:20 +02:00
using System.Collections.Generic;
using System.Linq;
2012-05-04 12:52:20 +02:00
namespace MapControl
{
/// <summary>
/// A collection of Locations with support for parsing.
2012-05-04 12:52:20 +02:00
/// </summary>
public partial class LocationCollection : List<Location>
2012-05-04 12:52:20 +02:00
{
public LocationCollection()
{
}
public LocationCollection(IEnumerable<Location> locations)
: base(locations)
2012-05-04 12:52:20 +02:00
{
}
public LocationCollection(params Location[] locations)
: base(locations)
2012-05-04 12:52:20 +02:00
{
}
2012-05-04 12:52:20 +02:00
public static LocationCollection Parse(string s)
{
var strings = s.Split(new char[] { ' ', ';' }, StringSplitOptions.RemoveEmptyEntries);
2012-05-04 12:52:20 +02:00
return new LocationCollection(strings.Select(l => Location.Parse(l)));
2012-05-04 12:52:20 +02:00
}
}
}