文件保存对话框
// 获取默认数据库var gdbPath = Project.Current.DefaultGeodatabasePath;//设置文件的保存路径SaveItemDialog saveLayerFileDialog = new SaveItemDialog(){Title = "Save Layer File",OverwritePrompt = true,//获取或设置当同名文件已存在时是否出现提示。InitialLocation = gdbPath,Filter = ItemFilters.FeatureClasses_All};saveLayerFileDialog.ShowDialog();
文件选择对话框
// 获取默认数据库var gdbPath = Project.Current.DefaultGeodatabasePath;//设置文件的保存路径OpenItemDialog openFileDialog = new OpenItemDialog (){Title = "open File",InitialLocation = gdbPath,Filter = ItemFilters.FeatureClasses_All};openFileDialog .ShowDialog();
参考文献:
SaveItemDialog 类 - ArcGIS Pro
OpenItemDialog 类—ArcGIS Pro