public MinLaunchReport(LaunchResult result, LaunchOptions options) { #region KMCCC信息 LauncherType = KMCCC_TYPE; LauncherVersion = Version; #endregion #region 系统信息 RuntimeVersion = Environment.Version.ToString(); SystemVersion = Environment.OSVersion.VersionString; Memory = ((uint)(SystemTools.GetTotalMemory() >> 20)); Arch = SystemTools.GetArch(); #endregion #region 启动信息 LaunchErrorType = result.ErrorType.ToString(); AuthenticationType = options.Authenticator.Type; #endregion }
private async void Refresh() { config = DeepCloneObject(App.config.MainConfig); debugCheckBox.DataContext = config.Launcher; javaPathComboBox.ItemsSource = App.javaList; environmentGrid.DataContext = config.Environment; memorySlider.Maximum = SystemTools.GetTotalMemory(); customGrid.DataContext = config.Customize; AccentColorComboBox.ItemsSource = ThemeManager.Accents; appThmeComboBox.ItemsSource = ThemeManager.AppThemes; serverGroupBox.DataContext = config.Server; authtypeCombobox.ItemsSource = authTypes; authtypeCombobox.SelectedItem = authTypes.Where(x => { return(x.Type == config.User.AuthenticationType); }).FirstOrDefault(); userGrid.DataContext = config.User; VersionsComboBox.ItemsSource = await App.handler.GetVersionsAsync(); if (App.config.MainConfig.Environment.VersionIsolation) { VersionsComboBox.IsEnabled = true; } else { VersionsComboBox.IsEnabled = false; versionOptionsGrid.ItemsSource = await GameHelper.GetOptionsAsync(App.handler, new Core.Modules.Version() { ID = "null" }); } }
private async void Refresh() { //绑定content设置 this.DataContext = App.Config.MainConfig; #region 元素初始化 javaPathComboBox.ItemsSource = App.JavaList; memorySlider.Maximum = SystemTools.GetTotalMemory(); VersionsComboBox.ItemsSource = await App.Handler.GetVersionsAsync(); #endregion if (App.Config.MainConfig.Environment.VersionIsolation) { VersionsComboBox.IsEnabled = true; } else { VersionsComboBox.IsEnabled = false; versionOptionsGrid.ItemsSource = await GameHelper.GetOptionsAsync(App.Handler, new NsisoLauncherCore.Modules.Version() { ID = "null" }); } //debug }
private string GetEnvironmentInfo() { StringBuilder builder = new StringBuilder(); builder.Append("\r\n==========环境信息=========="); builder.Append("\r\nCPU信息:" + SystemTools.GetProcessorInfo()); builder.Append("\r\n内存信息: 总大小:" + SystemTools.GetTotalMemory().ToString() + "MB/可用大小:" + SystemTools.GetRunmemory().ToString() + "MB"); builder.Append("\r\n显卡信息:" + SystemTools.GetVideoCardInfo()); builder.Append("\r\n操作系统:" + Environment.OSVersion.Platform); builder.Append("\r\n版本号:" + Environment.OSVersion.VersionString); builder.Append("\r\n系统位数:" + SystemTools.GetSystemArch()); builder.Append("\r\n程序运行命令行:" + Environment.CommandLine); builder.Append("\r\n程序工作目录:" + Environment.CurrentDirectory); return(builder.ToString()); }
private async void Refresh() { //绑定content设置 DataContext = App.Config.MainConfig; javaPathComboBox.ItemsSource = App.JavaList; memorySlider.Maximum = SystemTools.GetTotalMemory(); authModules.Clear(); foreach (var item in App.Config.MainConfig.User.AuthenticationDic) { if (item.Key is "offline" or "online" or "Microsoft") { continue; } authModules.Add(new KeyValuePair <string, AuthenticationNodeObj>(item.Key, item.Value)); } VersionsComboBox.ItemsSource = await App.Handler.GetVersionsAsync(); Lauguage.ItemsSource = new List <string>() { "中文", "日本語", "English" }; Lauguage.SelectedItem = App.Config.MainConfig.Lauguage; if (App.Config.MainConfig.Environment.VersionIsolation) { VersionChose.Visibility = Visibility.Visible; } else { VersionChose.Visibility = Visibility.Collapsed; versionOptionsGrid.ItemsSource = await GameHelper.GetOptionsAsync(VersionOption.Type.options, App.Handler, new() { ID = "null" }); versionOptionsofGrid.ItemsSource = await GameHelper.GetOptionsAsync(VersionOption.Type.optionsof, App.Handler, new() { ID = "null" }); } CheckBox_Checked(null, null); checkBox2_s_Check(null, null); isload = false; }
private async void Refresh() { //深度克隆设置 config = DeepCloneObject(App.Config.MainConfig); //绑定content设置 this.DataContext = config; #region 元素初始化 javaPathComboBox.ItemsSource = App.JavaList; memorySlider.Maximum = SystemTools.GetTotalMemory(); #region 自定义验证模型 authModules.Clear(); foreach (var item in config.User.AuthenticationDic) { authModules.Add(new KeyValuePair <string, AuthenticationNode>(item.Key, item.Value)); } #endregion VersionsComboBox.ItemsSource = await App.Handler.GetVersionsAsync(); #endregion if (App.Config.MainConfig.Environment.VersionIsolation) { VersionsComboBox.IsEnabled = true; } else { VersionsComboBox.IsEnabled = false; versionOptionsGrid.ItemsSource = await GameHelper.GetOptionsAsync(App.Handler, new NsisoLauncherCore.Modules.Version() { ID = "null" }); } //debug }