private void UpdateLifsStatus(LDD.LDDEnvironment environment) { string tmpPath = environment.ApplicationDataPath; if (environment != null && environment.DirectoryExists(LDD.LddDirectory.ApplicationData) && ValidateAppDataPath(ref tmpPath)) { DbStatusLabel.ForeColor = environment.DatabaseExtracted ? Color.Green : Color.Red; DbStatusLabel.Text = environment.DatabaseExtracted ? LifExtractedMessage : LifNotExtractedMessage; ExtractDBButton.Enabled = !environment.DatabaseExtracted; } else { DbStatusLabel.ForeColor = Color.Black; DbStatusLabel.Text = LifNotFoundMessage; ExtractDBButton.Enabled = false; } tmpPath = environment.ProgramFilesPath; if (environment != null && environment.DirectoryExists(LDD.LddDirectory.ProgramFiles) && ValidateProgramPath(ref tmpPath)) { AssetsStatusLabel.ForeColor = environment.AssetsExtracted ? Color.Green : Color.Red; AssetsStatusLabel.Text = environment.AssetsExtracted ? LifExtractedMessage : LifNotExtractedMessage; ExtractAssetsButton.Enabled = !environment.AssetsExtracted; } else { AssetsStatusLabel.ForeColor = Color.Black; AssetsStatusLabel.Text = LifNotFoundMessage; ExtractAssetsButton.Enabled = false; } }
public static AppSettings CreateDefault(LDD.LDDEnvironment lddEnvironment) { var settings = new AppSettings() { LddApplicationDataPath = lddEnvironment?.ApplicationDataPath ?? string.Empty, LddProgramFilesPath = lddEnvironment?.ProgramFilesPath ?? string.Empty }; return(settings); }
private void FillLddSettings(LDD.LDDEnvironment environment) { environment?.CheckLifStatus(); using (FlagManager.UseFlag(nameof(FillLddSettings))) { PrgmFilePathTextBox.Value = environment?.ProgramFilesPath; AppDataPathTextBox.Value = environment?.ApplicationDataPath; UpdateLifsStatus(environment); } }
private void LddPathTextBoxes_ValueChanged(object sender, EventArgs e) { if (LoadingSettings) { return; } var tmpEnv = new LDD.LDDEnvironment(PrgmFilePathTextBox.Value, AppDataPathTextBox.Value); tmpEnv.CheckLifStatus(); UpdateLifsStatus(tmpEnv); }
private void FillSettings(LDD.LDDEnvironment environment) { LoadingSettings = true; PrgmFilePathTextBox.Value = environment?.ProgramFilesPath; AppDataPathTextBox.Value = environment?.ApplicationDataPath; UserCreationPathTextBox.Value = environment?.UserCreationPath; UpdateLifsStatus(environment); LoadingSettings = false; }
private void LddPathTextBoxes_ValueChanged(object sender, EventArgs e) { if (FlagManager.IsSet(nameof(FillLddSettings))) { return; } var tmpEnv = new LDD.LDDEnvironment(PrgmFilePathTextBox.Value, AppDataPathTextBox.Value); tmpEnv.CheckLifStatus(); UpdateLifsStatus(tmpEnv); HasSettingsChanged = !SettingsEnvironment.IsEqual(tmpEnv); }
private void ExtractLif(LDD.LddLif lif) { try { var tmpEnv = new LDD.LDDEnvironment(PrgmFilePathTextBox.Value, AppDataPathTextBox.Value); string lifFilePath = tmpEnv.GetLifFilePath(lif); string lifFolderPath = tmpEnv.GetLifFolderPath(lif); if (!string.IsNullOrEmpty(lifFilePath) && File.Exists(lifFilePath)) { using (var lifFile = LifFile.Open(lifFilePath)) lifFile.ExtractTempTo(lifFolderPath); } //LifFile.Open() } catch { } }