//点击查看图层内属性 private void layerLB_SelectionChanged(object sender, SelectionChangedEventArgs e) { selectLayerName = layerLB.SelectedItem as string; var result = DWGReader.ReadPropertyFromFile(selectFileName, selectLayerName); List <string> resultList = result.Item1; resultGeo = result.Item2; PropertyDG.ItemsSource = resultList; }
//选择要打开的CAD文件 private void InputFileBtn_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Set filter for file extension and default file extension dlg.DefaultExt = ".dwg"; dlg.Filter = "dwg documents (.dwg)|*.dwg"; // Get the selected file name and display in a TextBox if (dlg.ShowDialog() == true) { InputFileNameTB.Text = dlg.FileName; selectFileName = dlg.FileName; List <string> layerList = DWGReader.ReadLayerFromFile(dlg.FileName); layerLB.ItemsSource = layerList; // new DWGReader().ReadFile(dlg.FileName, @"E://shp/11.shp"); } }