mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 06:55:04 +00:00
Version 4: Upgrade to VS 2017
This commit is contained in:
parent
2aafe32e00
commit
ec47f225b3
142 changed files with 1828 additions and 18384 deletions
38
MapControl/Shared/LocationCollection.cs
Normal file
38
MapControl/Shared/LocationCollection.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// © 2017 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// An ObservableCollection of Location with support for parsing.
|
||||
/// </summary>
|
||||
public partial class LocationCollection : ObservableCollection<Location>
|
||||
{
|
||||
public LocationCollection()
|
||||
{
|
||||
}
|
||||
|
||||
public LocationCollection(IEnumerable<Location> locations)
|
||||
: base(locations)
|
||||
{
|
||||
}
|
||||
|
||||
public LocationCollection(List<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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue