layouts/framework/FrameSetting.xaml.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using tablegen2.logic;

namespace tablegen2.layouts
{
    /// <summary>
    /// FrameSetting.xaml 的交互逻辑
    /// </summary>
    public partial class FrameSetting : UserControl
    {
        public event Action ExcelDirChanged;
        public event Action ExportDirChanged;
        public event Action ExportFormatChanged;
        public event Action MoreSettingEvent;

        public FrameSetting()
        {
            InitializeComponent();
            if (AppData.Config != null)
            {
                txtExcelDir.Text = AppData.Config.ExcelDir;
                txtExportDir.Text = AppData.Config.ExportDir;
                cbExportFormat.SelectComboBoxItemByTag(AppData.Config.ExportFormat.ToString());
            }
        }

        public void browseExcelDirectory()
        {
            Util.performClick(btnBrowseExcelDir);
        }

        private void exportFormat_Selected(object sender, RoutedEventArgs e)
        {
            var item = sender as ComboBoxItem;
            var fmt = (TableExportFormat)Enum.Parse(typeof(TableExportFormat), item.Tag as string);
            if (fmt != TableExportFormat.Unknown)
            {
                AppData.Config.ExportFormat = fmt;
                AppData.saveConfig();
                if (ExportFormatChanged != null)
                    ExportFormatChanged.Invoke();
            }
        }

        private void btnBrowseExcelDir_Clicked(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
            dialog.Description = "请选择Excel目录";
            dialog.ShowNewFolderButton = true;
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (!string.IsNullOrEmpty(dialog.SelectedPath))
                {
                    txtExcelDir.Text = dialog.SelectedPath;
                    AppData.Config.ExcelDir = dialog.SelectedPath;
                    AppData.saveConfig();
后面还有 53 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。