Beispiel #1
0
        static MainForm()
        {
            var T = new ShapeFileFormat[] { new Type1ShapeFileFormat(), new Type2ShapeFileFormat() };

            ShapeFileFormatKeys = new String[T.Length];
            ShapeFileFormats = new Dictionary<String, ShapeFileFormat>();

            var I = 0;
            foreach (var i in T)
            {
                ShapeFileFormatKeys[I] = i.Name;
                ShapeFileFormats.Add(i.Name, i);
                I++;
            }
        }
Beispiel #2
0
 private void LoadShape(String Path, ShapeFileFormat Format)
 {
     try
     {
         using (var Reader = new IO.StreamReader(IO.File.Open(Path, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)))
         {
             this.Project.Shape.Shapes.Add(Format.ReadShape(Reader));
         }
         this.AddShapeRecent(Path, Format);
         this.SaveProject();
     }
     catch (Exception ex)
     {
         ErrorDialog.Show("Could not load file.", ex, new StackTrace(true));
     }
 }
Beispiel #3
0
 private void AddShapeRecent(String Item, ShapeFileFormat Format)
 {
     this.AddShapeRecent(Item, Array.IndexOf(ShapeFileFormatKeys, Format.Name));
 }