Exemplo n.º 1
0
 Route(string path)
 {
     if (Directory.Exists(path))
     {
         var trkFilePath = MSTSPath.GetTRKFileName(path);
         try
         {
             var trkFile = new RouteFile(trkFilePath);
             Name        = trkFile.Tr_RouteFile.Name.Trim();
             RouteID     = trkFile.Tr_RouteFile.RouteID;
             Description = trkFile.Tr_RouteFile.Description.Trim();
         }
         catch
         {
             Name = "<" + catalog.GetString("load error:") + " " + System.IO.Path.GetFileName(path) + ">";
         }
         if (string.IsNullOrEmpty(Name))
         {
             Name = "<" + catalog.GetString("unnamed:") + " " + System.IO.Path.GetFileNameWithoutExtension(path) + ">";
         }
         if (string.IsNullOrEmpty(Description))
         {
             Description = null;
         }
     }
     else
     {
         Name = "<" + catalog.GetString("missing:") + " " + System.IO.Path.GetFileName(path) + ">";
     }
     Path = path;
 }