Esempio n. 1
0
 private void Viewer_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(DataFormats.FileDrop))
     {
         var files = (string[])e.Data.GetData(DataFormats.FileDrop);
         if (files[0].EndsWith("cml"))
         {
             var doc = CityDocument.Open(files[0]);
             if (DocumentManager.Switch(doc))
             {
                 NewDocument();
             }
         }
     }
 }
Esempio n. 2
0
        private void openWithoutFactorsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Title  = "Open CityXML";
            ofd.Filter = "CityXML File (*.cml)|*.cml";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                var doc = CityDocument.Open(ofd.FileName);
                if (DocumentManager.Switch(doc))
                {
                    NewDocument();
                }
            }
        }