mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
41 lines
1 KiB
C#
41 lines
1 KiB
C#
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
|
// © 2019 Clemens Fischer
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace MapControl
|
|
{
|
|
/// <summary>
|
|
/// A collection of Locations with support for parsing.
|
|
/// </summary>
|
|
#if !WINDOWS_UWP
|
|
[System.ComponentModel.TypeConverter(typeof(LocationCollectionConverter))]
|
|
#endif
|
|
public class LocationCollection : List<Location>
|
|
{
|
|
public LocationCollection()
|
|
{
|
|
}
|
|
|
|
public LocationCollection(IEnumerable<Location> locations)
|
|
: base(locations)
|
|
{
|
|
}
|
|
|
|
public LocationCollection(params Location[] locations)
|
|
: base(locations)
|
|
{
|
|
}
|
|
|
|
public static LocationCollection Parse(string s)
|
|
{
|
|
var strings = s.Split(new char[] { ' ', ';' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
return new LocationCollection(strings.Select(l => Location.Parse(l)));
|
|
}
|
|
}
|
|
}
|