年度变更建库软件5.0版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

102 lines
4.2 KiB

using KGIS.Framework.Maps;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.Plugin.BGResultManager.ViewModel;
using Kingo.PluginServiceInterface;
using System;
using System.Windows;
namespace Kingo.Plugin.BGResultManager.View
{
/// <summary>
/// FrmResultsExportForBG.xaml 的交互逻辑
/// </summary>
public partial class FrmResultsExportForBG : BaseWindow
{
public FrmResultsExportForBG()
{
try
{
InitializeComponent();
if ((MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo).ProjSuffix == ".KBG")
{
DataContext = new ExportBGViewModel();
}
}
catch (Exception ex)
{
LogAPI.Debug("一键成果导出 异常: " + ex + " ; ");
}
}
private void btnSelectDir_Click(object sender, RoutedEventArgs e)
{
try
{
System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
folderBrowserDialog.Description = "请选择文件夹路径";
folderBrowserDialog.ShowNewFolderButton = true;
if (!string.IsNullOrWhiteSpace(Properties.Settings.Default.LastSelectedFolder) && System.IO.Directory.Exists(Properties.Settings.Default.LastSelectedFolder))
{
folderBrowserDialog.SelectedPath = Properties.Settings.Default.LastSelectedFolder;
}
else
{
folderBrowserDialog.RootFolder = Environment.SpecialFolder.Desktop;
}
if (folderBrowserDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
{
return;
}
Properties.Settings.Default.LastSelectedFolder = folderBrowserDialog.SelectedPath.ToString();
Properties.Settings.Default.Save();
if (string.IsNullOrWhiteSpace(folderBrowserDialog.SelectedPath))
{
return;
}
txtOutDir.Text = folderBrowserDialog.SelectedPath;
}
catch (Exception ex)
{
LogAPI.Debug("一键变更成果导出 期间 选择保存目录 时失败,异常原因: " + ex + " ; ");
}
}
private void btnSelectNCData_Click(object sender, RoutedEventArgs e)
{
try
{
MessageHelper.ShowTips("请选择基础数据汇总表格,如:.../基础数据包");
System.Windows.Forms.FolderBrowserDialog folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
folderBrowserDialog.Description = "请选择文件夹路径";
folderBrowserDialog.ShowNewFolderButton = true;
if (!string.IsNullOrWhiteSpace(Properties.Settings.Default.LastSelectedFolder) && System.IO.Directory.Exists(Properties.Settings.Default.LastSelectedFolder))
{
folderBrowserDialog.SelectedPath = Properties.Settings.Default.LastSelectedFolder;
}
else
{
folderBrowserDialog.RootFolder = Environment.SpecialFolder.Desktop;
}
if (folderBrowserDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
{
return;
}
Properties.Settings.Default.LastSelectedFolder = folderBrowserDialog.SelectedPath.ToString();
Properties.Settings.Default.Save();
if (string.IsNullOrWhiteSpace(folderBrowserDialog.SelectedPath))
{
return;
}
txtNCData.Text = folderBrowserDialog.SelectedPath;
}
catch (Exception ex)
{
LogAPI.Debug("一键变更成果导出 期间 选择基础数据 时失败,异常原因: " + ex + " ; ");
}
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}