MainWindow.xaml.cs

(完整代码) 1KB

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.Navigation;
using System.Windows.Shapes;

namespace WarThunderSlotsSavior {
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            refreshBackupStatus();
        }
        
        protected override void OnClosed(EventArgs e) {
            App.Current.Shutdown();
        }

        public void refreshBackupStatus() {
            string dateString = WTSetting.LastBackupDateString();
            bool hasBackup = dateString != null;
            restoreButton.IsEnabled = hasBackup;
            lastBackupDateLabel.Content = hasBackup ? App.Current.Resources["lastCaption"] + " " + dateString : App.Current.Resources["noBackupStatus"];
        }


        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) {
            base.OnMouseLeftButtonDown(e);

            // Begin dragging the window
            DragMove();
        }

        private void backupButton_Click(object sender, RoutedEventArgs e) {
            WTSetting.Backup();
            refreshBackupStatus();
        }

        private void restoreButton_Click(object sender, RoutedEventArgs e) {
            WTSetting.Restore();
        }

        private void infoButton_Click(object sender, RoutedEventArgs e) {
            MessageBox.Show("Github: https://github.com/wolfcon \nQQ: 472730949 \nWarThunder ID: conMan", "I am Frank!");
        }
    }
}

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

AI 解读 AI

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

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