Exemplo n.º 1
0
 protected GeoPlanetVectorData(SerializationInfo info, StreamingContext context)
 {
     this.m_LineCollection = new List<GeoDisplayLine>();
     base.m_DataSource = info.GetString("DataSource");
     this.m_VectorBound = (GeoXYRect) info.GetValue("VectorBound", typeof(GeoXYRect));
     this.m_MenuFile = (GeoMenuFile) info.GetValue("MenuFile", typeof(GeoMenuFile));
     this.m_VectorType = info.GetString("VectorType");
     this.m_DefaultLineStyle = (GeoLineStyle) info.GetValue("DefaultLineStyle", typeof(GeoLineStyle));
     this.m_VectorTypeCollection = (Dictionary<short, string>) info.GetValue("VectorTypeCollection", typeof(Dictionary<short, string>));
     base.m_Name = info.GetString("Name");
     base.m_FolderNodeName = info.GetString("FolderNodeName");
     this.Read();
 }
Exemplo n.º 2
0
 public GeoPlanetVectorData(GeoMenuFile menuFile) : this()
 {
     this.m_MenuFile = menuFile;
     this.m_VectorTypeCollection = this.m_MenuFile.TypeDictionary;
 }
Exemplo n.º 3
0
 private List<IGeoRasterData> LoadPlanetClutterData()
 {
     List<IGeoRasterData> list = new List<IGeoRasterData>();
     if (!this.CheckClutterPath())
     {
         this.m_IsAnyFileNotExist = true;
         this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Clutter index file or menu file is error!\r\n";
         this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Your clutter file path is " + this.m_CurrentProjectFolder.ClutterIndexPath + "\r\n";
         this.m_CurrentProjectFolder.ClutterIndexPath = "";
         return list;
     }
     GeoIndexFile file = new GeoIndexFile(this.m_CurrentProjectFolder.ClutterIndexPath);
     if (!file.Read())
     {
         this.m_IsAnyFileNotExist = true;
         this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Clutter index file or menu file is error!\r\n";
         this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Your clutter file path is " + this.m_CurrentProjectFolder.ClutterIndexPath + "\r\n";
         this.m_CurrentProjectFolder.ClutterIndexPath = "";
         return list;
     }
     GeoMenuFile geoMenuFile = new GeoMenuFile(this.m_CurrentProjectFolder.ClutterMenuPath);
     string folderNodeName = this.GetFolderNodeName(NodeType.Clutter, this.m_CurrentProjectFolder.ClutterIndexPath);
     string directoryName = Path.GetDirectoryName(this.m_CurrentProjectFolder.ClutterIndexPath);
     for (int i = 0; i < file.BinaryFileName.Count; i++)
     {
         GeoXYRect geoBound = new GeoXYRect(file.LeftOfBound[i], file.RightOfBound[i], file.BottomOfBound[i], file.TopOfBound[i]);
         string path = Path.Combine(directoryName, file.BinaryFileName[i]);
         if (!File.Exists(path))
         {
             string str4 = string.Format("Clutter file {0} doesn't exist.", path);
             this.m_LoadingErrorStr = this.m_LoadingErrorStr + str4 + "\r\n";
         }
         else
         {
             GeoDiscreteData item = new GeoPlanetClutterData(path, geoMenuFile, geoBound, file.Resolution[i]);
             item.FolderNodeName = folderNodeName;
             item.Read();
             list.Add(item);
         }
     }
     return list;
 }
Exemplo n.º 4
0
 public void LoadVectorData()
 {
     if (!this.CheckVectorFile())
     {
         MultiThreadNum.CurrentProgressValue += 0x12;
     }
     else
     {
         StreamReader reader = null;
         GeoMenuFile menuFile = null;
         try
         {
             menuFile = new GeoMenuFile(this.m_CurrentProjectFolder.VectorMenuPath);
             reader = new StreamReader(new OpenFileAssist(this.m_CurrentProjectFolder.VectorIndexPath).FileStrm, Encoding.Default);
             string folderNodeName = this.GetFolderNodeName(NodeType.Vector, this.m_CurrentProjectFolder.VectorIndexPath);
             while (!reader.EndOfStream)
             {
                 try
                 {
                     string tmpALine = reader.ReadLine().Trim();
                     if (tmpALine == "")
                     {
                         continue;
                     }
                     GeoPlanetVectorData dataToAdd = new GeoPlanetVectorData(menuFile);
                     dataToAdd.FolderNodeName = folderNodeName;
                     dataToAdd.ParseOneLine(tmpALine, Directory.GetParent(this.m_CurrentProjectFolder.VectorIndexPath).FullName);
                     dataToAdd.Read();
                     this.AddVectorData(this.m_PlanetVectorData, dataToAdd, NodeType.Vector);
                 }
                 catch (Exception exception)
                 {
                     this.m_LoadingErrorStr = this.m_LoadingErrorStr + exception.Message + "\r\n";
                     continue;
                 }
             }
         }
         catch
         {
             this.m_IsAnyFileNotExist = true;
             this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Vector index file or menu file is error!\r\n";
             this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Your vector file path is " + this.m_CurrentProjectFolder.VectorIndexPath + "\r\n";
             this.m_CurrentProjectFolder.VectorIndexPath = "";
         }
         finally
         {
             reader.Close();
         }
         List<string> list = new List<string>();
         foreach (IGeoVectorData data2 in this.m_PlanetVectorData)
         {
             list.Add((data2 as GeoPlanetVectorData).VectorType);
         }
         this.m_GeoVectorTypeColletion.TypeDictionary = menuFile.TypeDictionary;
     }
 }
Exemplo n.º 5
0
 public void LoadAttPtData()
 {
     if (!this.CheckAttPtFile())
     {
         MultiThreadNum.CurrentProgressValue += 9;
     }
     else
     {
         StreamReader reader = null;
         GeoMenuFile menuFile = null;
         try
         {
             menuFile = new GeoMenuFile(this.m_CurrentProjectFolder.VectorMenuPath);
             reader = new StreamReader(new OpenFileAssist(this.m_CurrentProjectFolder.AttPtIndexPath).FileStrm, Encoding.Default);
             string folderNodeName = this.GetFolderNodeName(NodeType.Text, this.m_CurrentProjectFolder.AttPtIndexPath);
             while (!reader.EndOfStream)
             {
                 try
                 {
                     string tmpALine = reader.ReadLine().Trim();
                     if (tmpALine == "")
                     {
                         continue;
                     }
                     GeoTextData dataToAdd = new GeoTextData(menuFile);
                     dataToAdd.FolderNodeName = folderNodeName;
                     dataToAdd.ParseOneLine(tmpALine, Directory.GetParent(this.m_CurrentProjectFolder.AttPtIndexPath).FullName);
                     dataToAdd.Read();
                     this.AddVectorData(this.m_TextVectorData, dataToAdd, NodeType.Text);
                 }
                 catch (Exception exception)
                 {
                     this.m_LoadingErrorStr = this.m_LoadingErrorStr + exception.Message + "\r\n";
                     continue;
                 }
             }
         }
         catch
         {
             this.m_IsAnyFileNotExist = true;
             this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Text index file or menu file is error!\r\n";
             this.m_LoadingErrorStr = this.m_LoadingErrorStr + "Your text  file path is " + this.m_CurrentProjectFolder.AttPtIndexPath + "\r\n";
             this.m_CurrentProjectFolder.AttPtIndexPath = "";
         }
         this.m_GeoAttPtTypeColletion.TypeDictionary = menuFile.TypeDictionary;
     }
 }