SubWindow/SystemSetting.xaml.cs

(开头部分) 3KB

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

using Microsoft.Win32;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Chess.SubWindow
{
    /// <summary>
    /// SystemSetting.xaml 的交互逻辑
    /// </summary>
    public partial class SystemSetting : Window
    {
        public SystemSetting()
        {
            InitializeComponent();
        }
        private void OnWindowLoaded(object sender, RoutedEventArgs e)
        {
            //MoveDelayTime.Value = Settings.Default.MoveDelayTime;
            //ArrowsShowOrHidden.IsChecked = Settings.Default.ArrowVisable;
            //ArrowMaxNumSlider.Value = Settings.Default.ArrowsMaxNum;
            CustomClass.HuoHuan huoHuan = new CustomClass.HuoHuan();
            DongHuaGrid.Children.Add(huoHuan);
        }
        private void OnWindowUnloaded(object sender, RoutedEventArgs e)
        {
            Settings.Default.Save();
        }
        /// <summary>
        /// 选择窗口背景图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectBKImage(object sender, RoutedEventArgs e)
        {
            string imageDefaultPath = $"{AppDomain.CurrentDomain.BaseDirectory}picture\\BackGround\\";
            // 注意Debug和Release模式的区别,所选模式模式不同,AppDomain.CurrentDomain.BaseDirectory对应的文件夹也不同。它更不是原代码所在的文件夹

            OpenFileDialog openFileDialog = new()
            {
                Filter = "图像文件|*.jpg;*.jpeg;*.png;*.bmp;|所有文件|*.*",
                InitialDirectory = imageDefaultPath,
                DefaultExt = string.Empty,
                RestoreDirectory = true,
                Title = "选择窗口背景图片"
            };
            if ((bool)openFileDialog.ShowDialog())
            {
后面还有 38 行代码,解锁后查看完整代码

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

AI 解读

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

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