Example #1
0
        public MapForm()
        {
            InitializeComponent();

            mapData = new MapData();
            mapData.layers.Add(new MapLayer());

            try
            {
                clearImg = new Surface("clear.bmp");
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }

            mapSurface = new Surface(surfacePanel.Width, surfacePanel.Height);
            wholeSurface = new Surface(surfacePanel.Width, surfacePanel.Height);

            showGridToolStripMenuItem.Checked = true;

            urManager = new UndoRedoHistory(this);

            Clear();
        }
        public static void Import(string filename, MapData data, bool showDialog)
        {
            foreach (FileTranslator ft in fileTranslators)
            {
                if (filename.EndsWith(ft.Extension()))
                {
                    ft.Import(filename, data, showDialog);
                    return;
                }
            }

            throw new Exception("No FileTranslator found for the specified file.");
        }