コード例 #1
0
 protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
 {
     base.OnClosing(e);
     RCONWindow.CloseAllWindows();
     PlayerListWindow.CloseAllWindows();
     this.versionChecker.DisposeAsync().DoNotWait();
 }
コード例 #2
0
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            base.OnClosing(e);
            RCONWindow.CloseAllWindows();
            PlayerListWindow.CloseAllWindows();
            this.versionChecker.DisposeAsync().DoNotWait();

            var installFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var backupFolder  = IOUtils.NormalizePath(string.IsNullOrWhiteSpace(Config.Default.BackupPath)
                ? Path.Combine(Config.Default.DataDir, Config.Default.BackupDir)
                : Path.Combine(Config.Default.BackupPath));

            SettingsUtils.BackupUserConfigSettings(Config.Default, "userconfig.json", installFolder, backupFolder);
        }
コード例 #3
0
        public static PlayerListWindow GetWindowForServer(Server server)
        {
            if (!Windows.TryGetValue(server, out PlayerListWindow window) || !window.IsLoaded)
            {
                window = new PlayerListWindow(new PlayerListParameters()
                {
                    WindowTitle   = String.Format(GlobalizedApplication.Instance.GetResourceString("PlayerList_TitleLabel"), server.Runtime.ProfileSnapshot.ProfileName),
                    WindowExtents = server.Profile.PlayerListWindowExtents,

                    Server           = server,
                    ServerMap        = ServerProfile.GetProfileMapName(server?.Profile),
                    InstallDirectory = server.Runtime.ProfileSnapshot.InstallDirectory,
                    ProfileName      = server.Runtime.ProfileSnapshot.ProfileName,
                });
                Windows[server] = window;
            }

            return(window);
        }