Пример #1
0
 /// <summary>
 /// Create an instance of a Gpx Analyser
 /// </summary>
 /// <param name="options">options of Analyser</param>
 private GpxAnalyser(GpxAnalyserOptions options = null)
 {
     if (options != null)
     {
         Options = options;
     }
     else
     {
         Options = new GpxAnalyserOptions();
     }
 }
Пример #2
0
 /// <summary>
 /// Create an instance of a Gpx Analyser
 /// </summary>
 /// <param name="Url">Url of gpx File</param>
 /// <param name="options">options of Analyser</param>
 public GpxAnalyser(string url, GpxAnalyserOptions options = null) : this(options)
 {
     Stream stream = null;
     if (IsLocalPath(url))
     {
         stream = new FileStream(url, FileMode.Open);
     }
     else
     {
         using (var client = new HttpClient())
         {
             var get = client.GetStreamAsync(url);
             get.Wait();
             stream = get.Result;
         }
     }
     gpxReader = new GpxReader(stream);
 }
Пример #3
0
 /// <summary>
 /// Create an instance of a Gpx Analyser
 /// </summary>
 /// <param name="gpxReader">Gpx Reader cannot be null</param>
 /// <param name="options">options of Analyser</param>
 public GpxAnalyser(GpxReader gpxReader, GpxAnalyserOptions options = null) : this(options)
 {
     this.gpxReader = gpxReader ?? throw new ArgumentNullException(nameof(gpxReader));
 }