private void deleteTrackToolStripButton_Click(object sender, EventArgs e) { // Click on 'delete button' if (customTracksListView.SelectedItems.Count == 1 && MessageBoxes.ShowQuestion(this, _QUESTION_DELETE_TRACK, MessageBoxButtons.YesNo) == DialogResult.Yes) { Cursor = Cursors.WaitCursor; try { ListViewItem selectedItem = customTracksListView.SelectedItems[0]; DFE selectedTrack = selectedItem.Tag as DFE; if (selectedTrack != null) { File.Delete(selectedTrack.FileName); // Refresh _RefreshCustomList(); StatusBarLogManager.ShowEvent(this, _STATUS_DELETE_OK); } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { Cursor = Cursors.Default; } } }
/// <summary> /// Allows to change brake diameter /// </summary> /// <param name="isFrontBrakes"></param> private void _ChangeBrakesDiameter(bool isFrontBrakes) { string currentValue = (isFrontBrakes ? frontBrakesLabel.Text.Split('ø')[1] : rearBrakesLabel.Text.Split('ø')[1]); string message = (isFrontBrakes ? _MESSAGE_ENTER_FRONT_DIAMETER : _MESSAGE_ENTER_REAR_DIAMETER); PromptBox pBox = new PromptBox(_TITLE_BRAKES_DIAMETER, message, currentValue); DialogResult dr = pBox.ShowDialog(this); if (dr == DialogResult.OK && pBox.IsValueChanged) { Cursor = Cursors.WaitCursor; // Changing displacement string columnName = (isFrontBrakes ? SharedConstants.BRAKES_DIM_FRONT_PHYSICS_DB_COLUMN : SharedConstants.BRAKES_DIM_REAR_PHYSICS_DB_COLUMN); string newValue = pBox.ReturnValue; DatabaseHelper.UpdateCellFromTopicWherePrimaryKey(_PhysicsTable, columnName, _CurrentVehicle, newValue); // Reloading _InitializeDatasheetContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_BRAKE_DIAMETER_OK); Cursor = Cursors.Default; } }
private void customTracksListView_ItemCheck(object sender, ItemCheckEventArgs e) { // A track is being checked > perform control over replacing if (e.NewValue == CheckState.Checked) { // Does it replace any challenge ? ListViewItem item = customTracksListView.Items[e.Index]; string replaced = item.SubItems[3].Text; if (_ITEM_REPLACES_NONE.Equals(replaced)) { e.NewValue = CheckState.Unchecked; StatusBarLogManager.ShowEvent(this, _STATUS_ACTIVATE_KO_NO_REPLACEMENT); } else { // Does another track replace the same challenge ? foreach (ListViewItem anotherItem in customTracksListView.Items) { if (anotherItem != item && anotherItem.Checked) { string anotherReplaced = anotherItem.SubItems[3].Text; if (anotherReplaced.Equals(replaced)) { e.NewValue = CheckState.Unchecked; StatusBarLogManager.ShowEvent(this, _STATUS_ACTIVATE_KO_ALREADY_REPLACED); } } } } } }
private void tiresToolStripMenuItem_Click(object sender, EventArgs e) { // Click on 'Tires' menu item try { bool isModified = _ChangeTires(); if (isModified) { Cursor = Cursors.WaitCursor; // Reloading _InitializeDatasheetContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_TIRES_OK); Cursor = Cursors.Default; } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void setVehiclePerformanceButton_Click(object sender, EventArgs e) { // Click on 'Set' button (performance datasheet) try { Cursor = Cursors.WaitCursor; _ChangePerformanceData(); // Modification flag _IsDatabaseModified = true; // Reloading: not needed //_InitializeDatasheetContents(); StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_PERF_OK); } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { Cursor = Cursors.Default; } }
private void verToolStripMenuItem_Click(object sender, EventArgs e) { // Click on 'Model' menu item try { bool isModified = _ChangeModelOrVersion(false); if (isModified) { Cursor = Cursors.WaitCursor; // Reloading _InitializeDatasheetContents(); // Vehicle names _UpdateSlotAndModName(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_RENAMING_OK); Cursor = Cursors.Default; } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void displacementToolStripMenuItem_Click(object sender, EventArgs e) { // Click on 'Displacement' menu item try { PromptBox pBox = new PromptBox("Engine displacement...", _MESSAGE_ENTER_DISPLACEMENT, engineDisplacementLabel.Text); DialogResult dr = pBox.ShowDialog(this); if (dr == DialogResult.OK && pBox.IsValueChanged) { Cursor = Cursors.WaitCursor; // Changing displacement string newValue = pBox.ReturnValue; DatabaseHelper.UpdateCellFromTopicWherePrimaryKey(_PhysicsTable, SharedConstants.DISPLACEMENT_PHYSICS_DB_COLUMN, _CurrentVehicle, newValue); // Reloading _InitializeDatasheetContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_DISPLACEMENT_OK); Cursor = Cursors.Default; } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void physicsEngineSetButton_Click(object sender, EventArgs e) { // Click on 'Set' button (engine location) try { Cursor = Cursors.WaitCursor; _ChangeEngineLocation(); _ChangeEngineOptions(); _ChangeSupercharger(); // Modification flag _IsDatabaseModified = true; // Reloading _InitializePhysicsContents(); StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_ENGINE_OK); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void physicsBodyworkSetButton_Click(object sender, EventArgs e) { // Click on Bodywork>Set button try { Cursor = Cursors.WaitCursor; _ChangeRideHeight(); _ChangeSuspension(); _ChangeBodyType(); _ChangeDimensions(); // Modification flag _IsDatabaseModified = true; // Reloading _InitializePhysicsContents(); StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_BODYWORK_OK); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void setVehicleTuningSpotButton_Click(object sender, EventArgs e) { // Click on 'Set' button if (_CurrentTuningBrand == null || string.IsNullOrEmpty(tuningSpotsComboBox.Text)) { return; } try { Cursor = Cursors.WaitCursor; _ChangeTuningSpot(); // Reloading _InitializeTunerContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_TUNING_SPOT_OK); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void fromTDUGenuineEditorToolStripMenuItem_Click(object sender, EventArgs e) { // Click on Import > from TDU Editor button try { Cursor = Cursors.WaitCursor; EditorTracksDialog dlg = new EditorTracksDialog(true); DialogResult dr = dlg.ShowDialog(this); if (dr == DialogResult.OK) { Couple <int> convertedCount = _ConvertIGEtoDFE(dlg.SelectedTracks); // Refresh custom tracks _RefreshCustomList(); string message = string.Format(_FORMAT_IMPORT_IGE_OK, convertedCount.FirstValue, convertedCount.SecondValue); StatusBarLogManager.ShowEvent(this, message); } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { Cursor = Cursors.Default; } }
/// <summary> /// Starts renaming of specified packed file /// </summary> /// <param name="packedFilePath"></param> /// <param name="newFileName"></param> private bool _RenamePackedFile(string packedFilePath, string newFileName) { bool result = false; try { Cursor = Cursors.WaitCursor; _CurrentBnkFile.RenamePackedFile(packedFilePath, newFileName); SetBnkContentsChanged(); StatusBarLogManager.ShowEvent(this, _STATUS_RENAME_SUCCESS); result = true; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { Cursor = Cursors.Default; } return(result); }
private void modifyButton_Click(object sender, EventArgs e) { if (entryList.SelectedItems.Count == 0) { return; } // On récupère l'entrée sélectionnée try { UInt32 id = UInt32.Parse(entryList.SelectedItems[0].SubItems[1].Text); MAP.Entry entryToModify = leMAP.EntryList[id]; // Affichage de la fenêtre de modification DialogResult dr = new SizeModifierForm(entryToModify, leMAP).ShowDialog(this); // Des modifications ? if (dr != DialogResult.Cancel) { // EVO 30 : mise à jour de la ligne uniquement _UpdateSingleEntry(entryList.SelectedItems[0], id); Cursor = Cursors.Default; // EVO 32 StatusBarLogManager.ShowEvent(this, _STATUS_CHANGE_SUCCESS); } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void analyzeButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tduPath.Text) || leMAP == null) { return; } try { Cursor = Cursors.WaitCursor; StatusBarLogManager.ShowEvent(this, _STATUS_ANALYSING); // Lance l'analyse Dictionary <string, long> currentFileList = MAP.ReportTDUFiles(tduPath.Text); // Tente l'association StringCollection failedFiles = new StringCollection(); idList = leMAP.LinkEntriesToFiles(currentFileList, laCle, failedFiles); // Met à jour la liste de fichiers _UpdateFileList(); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { // EVO 32 StatusBarLogManager.ShowEvent(this, _STATUS_END_ANALYSIS); } }
private void resetCameraIKButton_Click(object sender, EventArgs e) { // Click on 'Reset All' button try { Cursor = Cursors.WaitCursor; // If custom camera is used, it is unchecked if (useOwnCamCheckBox.Checked) { useOwnCamCheckBox.Checked = false; } // Action _ResetCamIK(_CurrentVehicle, _PhysicsTable); // Refresh _RefreshCameraIKContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_RESETTING_CAMIK_OK); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void ikToolStripMenuItem_Click(object sender, EventArgs e) { // Click on 'Apply>IK' if (!string.IsNullOrEmpty(availableCamIKComboBox.Text)) { try { Cursor = Cursors.WaitCursor; // Action _SetCamOrIK(_CurrentVehicle, availableCamIKComboBox.Text, _PhysicsTable, false); // Refresh _RefreshCameraIKContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_SETTING_IK_OK); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } } }
private void exportOKResultsButton_Click(object sender, EventArgs e) { if (fileList.Items.Count == 0) { MessageBoxes.ShowInfo(this, _INFO_ANALYSIS_FIRST); return; } // Permet de sélectionner un fichier de sortie saveFileDialog.FileName = ""; saveFileDialog.Filter = GuiConstants.FILTER_XML_ALL_FILES; DialogResult dr = saveFileDialog.ShowDialog(this); if (dr == DialogResult.OK) { try { Cursor = Cursors.WaitCursor; _GenerateKEYFile(saveFileDialog.FileName, fileList.Items); Cursor = Cursors.Default; // EVO 32 StatusBarLogManager.ShowEvent(this, _STATUS_SUCCESS_GENERATE); } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } } }
private void deleteToolStripButton_Click(object sender, EventArgs e) { // Click on 'Delete' button if (_LeDB == null || entryList.SelectedItems.Count != 1 || entryList.SelectedIndices[0] == entryList.Items.Count - 1) { return; } try { Cursor = Cursors.WaitCursor; // Getting current identifier and corresponding entry string id = entryList.SelectedItems[0].SubItems[1].Text; DBResource.Entry currentEntry = _LeDB.GetEntryFromId(id); // Removing item _LeDB.DeleteEntry(currentEntry); _LeDB.Save(); // List update _UpdateEntryList(true); StatusBarLogManager.ShowEvent(this, _STATUS_DEL_SUCCESS); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void keepNameToolStripMenuItem_Click(object sender, EventArgs e) { // Clic sur le bouton de remplacement (mode "Keep Name") if (_GetSelectedFilePaths().Count != 0) { try { Collection <string> newFileNames; int modifiedCount = _ReplacePackedFiles(out newFileNames); if (modifiedCount >= 1) { Cursor = Cursors.WaitCursor; // BUG_18: rechargement SetBnkContentsChanged(); // EVO_32 : message de réussite string message = string.Format(_STATUS_REPLACE_SUCCESS_MANY, modifiedCount); StatusBarLogManager.ShowEvent(this, message); Cursor = Cursors.Default; } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { Cursor = Cursors.Default; } } }
private void tuneBrandNameChangeButton_Click(object sender, EventArgs e) { // Click on 'Change...' button if (string.IsNullOrEmpty(tuningBrandsComboBox.Text)) { return; } try { bool isModified = _ChangeTuningBrand(); if (isModified) { Cursor = Cursors.WaitCursor; // Reloading _InitializeTunerContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_CHANGING_TUNING_BRAND_OK); Cursor = Cursors.Default; } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }
private void easySetButton_Click(object sender, EventArgs e) { // Click on 'Set' button (easy way) if (!string.IsNullOrEmpty(easyVehicleComboBox.Text)) { try { Cursor = Cursors.WaitCursor; // Action _SetEasyCamIK(_CurrentVehicle, easyVehicleComboBox.Text, _PhysicsTable); // Refresh _RefreshCameraIKContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_SETTING_EASY_CAMIK_OK); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } } }
private void setVehicleLocationButton_Click(object sender, EventArgs e) { // Click on 'Set' button if (spotVehiclesListView.SelectedItems.Count == 1) { ListViewItem selectedItem = spotVehiclesListView.SelectedItems[0]; try { Cursor = Cursors.WaitCursor; _SetVehicleOnSlot(selectedItem); // Reloading _InitializeDealersContents(); _SelectSpotFromReference(_CurrentAvailabilitySpot); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_SETTING_VEHICLE_ON_DEALER_OK); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } } }
private void trackTimer_Tick(object sender, EventArgs e) { // Timer interval reached // For each selected custom track, locate replaced name in DFE folder foreach (ListViewItem anotherItem in customTracksListView.Items) { try { DFE currentTrack = anotherItem.Tag as DFE; if (currentTrack != null) { FileInfo customTrackInfo = new FileInfo(currentTrack.FileName); DFE replacedChallenge = _GetReplacedChallenge(customTrackInfo.Name); if (replacedChallenge != null) { FileInfo replacedChallengeInfo = new FileInfo(replacedChallenge.FileName); string tduDfeFileName = string.Concat(LibraryConstants.GetSpecialFolder(LibraryConstants.TduSpecialFolder.Data_DFE), replacedChallengeInfo.Name); FileInfo dfeTrackInfo = new FileInfo(tduDfeFileName); if (anotherItem.Checked) { // Checked > synchronization if (dfeTrackInfo.Exists && dfeTrackInfo.LastWriteTime != customTrackInfo.LastWriteTime) { File.Copy(currentTrack.FileName, tduDfeFileName, true); string message = string.Format(_FORMAT_TRACK_SYNC_OK, currentTrack.TrackName, replacedChallenge.TrackName); StatusBarLogManager.ShowEvent(this, message); SystemSounds.Exclamation.Play(); } } /*else * { * // Unchecked > restoration * // Disabled beacause of conflicts * if (dfeTrackInfo.Exists && dfeTrackInfo.LastWriteTime != replacedChallengeInfo.LastWriteTime) * { * File.Copy(replacedChallenge.FileName, tduDfeFileName, true); * * string message = string.Format(_FORMAT_TRACK_RESTORE_OK, replacedChallenge.TrackName); * * StatusBarLogManager.ShowEvent(this, message); * SystemSounds.Exclamation.Play(); * } * }*/ } } } catch (Exception ex) { Log.Error("A track synchronization issue has occured.", ex); } } }
/// <summary> /// Loads database and reference data /// </summary> private void _LoadDatabase() { Cursor = Cursors.WaitCursor; // colors ColorsHelper.InitReference(AppConstants.FOLDER_XML); StatusBarLogManager.ShowEvent(this, _STATUS_LOADING_DATABASE_SUCCESS); Cursor = Cursors.Default; }
private void useCustomCamCheckBox_CheckedChanged(object sender, EventArgs e) { // Click on 'Use own camera set' checkbox if (useOwnCamCheckBox.Checked) { // Vehicle now uses its own camera try { Cursor = Cursors.WaitCursor; // Action VehicleSlotsHelper.VehicleInfo vi = VehicleSlotsHelper.VehicleInformation[_CurrentVehicle]; VehicleSlotsHelper.ChangeCameraById(_CurrentVehicle, vi.newCamera, _PhysicsTable); // Refresh _RefreshCameraIKContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_SETTING_CUSTOM_CAM_OK); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } } else { // Restoring default camera Cursor = Cursors.WaitCursor; // Action VehicleSlotsHelper.VehicleInfo vi = VehicleSlotsHelper.VehicleInformation[_CurrentVehicle]; short defaultCamera = short.Parse(vi.defaultCamera); VehicleSlotsHelper.ChangeCameraById(_CurrentVehicle, defaultCamera.ToString(), _PhysicsTable); // Refresh _RefreshCameraIKContents(); // Modification flag _IsDatabaseModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_UNSETTING_CUSTOM_CAM_OK); Cursor = Cursors.Default; } }
private void viewChooseButton_Click(object sender, EventArgs e) { // Click on 'Choose front/rear...' buttons if (camSetDetailsListView.SelectedItems.Count == 1) { try { bool isForFront = (sender == viewChooseFrontButton); DialogResult dr = _CamViewSelectorDialog.ShowDialog(this); if (dr == DialogResult.OK) { Cursor = Cursors.WaitCursor; Cameras.ViewType currentViewType = (Cameras.ViewType)Enum.Parse(typeof(Cameras.ViewType), camSetDetailsListView.SelectedItems[0].Tag.ToString()); if (_CamViewSelectorDialog.ChosenCameraId == null && _CamViewSelectorDialog.ChosenViewId == null) { // View deletion _RemoveCameraView(customCameraIdLabel.Text, currentViewType, isForFront); } else { // View customization Cameras.ViewType chosenViewType = (Cameras.ViewType)Enum.Parse(typeof(Cameras.ViewType), _CamViewSelectorDialog.ChosenViewId); _CustomizeCameraView(customCameraIdLabel.Text, currentViewType, _CamViewSelectorDialog.ChosenCameraId, chosenViewType, isForFront); } // Refresh _RefreshCameraIKContents(); // Modification flag _IsCameraModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_CHOOSING_VIEW_OK); } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { Cursor = Cursors.Default; } } }
/// <summary> /// Réalise la conversion multiple /// </summary> private void _MultipleConvert() { // Vérifications if (string.IsNullOrEmpty(sourceBNKTextBox.Text) || string.IsNullOrEmpty(targetFolderTextBox.Text)) { return; } Cursor = Cursors.WaitCursor; // Parcours des fichiers et extraction des 2DB BNK bnkFile = TduFile.GetFile(sourceBNKTextBox.Text) as BNK; if (bnkFile == null) { throw new Exception(_ERROR_INVALID_BNK_FILE); } Collection <string> textureFiles = bnkFile.GetPackedFilesPathsByExtension(LibraryConstants.EXTENSION_2DB_FILE); string tempFolder = File2.SetTemporaryFolder(null, LibraryConstants.FOLDER_TEMP, true); foreach (string anotherFilePath in textureFiles) { // 1.Extraction depuis le BNK vers le dossier temporaire bnkFile.ExtractPackedFile(anotherFilePath, tempFolder, true); // 2.Conversion des fichiers 2DB>DDS string fileName = tempFolder + @"\" + bnkFile.GetPackedFileName(anotherFilePath); FileInfo fi = new FileInfo(fileName); string newFileName = targetFolderTextBox.Text + @"\" + File2.ChangeExtensionOfFilename(fi.Name, LibraryConstants.EXTENSION_DDS_FILE); // If file already exists, it is renamed Tools.RenameIfNecessary(newFileName, LibraryConstants.SUFFIX_OLD_FILE); GraphicsConverters._2DBToDDS(fileName, newFileName); } // EVO 32 string message = string.Format(_STATUS_SUCCESS_MULTIPLE, textureFiles.Count); StatusBarLogManager.ShowEvent(this, message); // On efface le champ source sourceBNKTextBox.Text = ""; // Mise à jour de l'emplacement des 2DB _2DBLocationLink.Text = tempFolder; Cursor = Cursors.Default; }
private void changeNameToolStripMenuItem_Click(object sender, EventArgs e) { // Clic sur le bouton de remplacement (mode "Change Name") Collection <string> selectedFilePaths = _GetSelectedFilePaths(); if (selectedFilePaths.Count > 0) { try { Collection <string> newFileNames; int modifiedCount = _ReplacePackedFiles(out newFileNames); if (modifiedCount >= 1) { Cursor = Cursors.WaitCursor; // Applies renaming with valid file names int index = 0; foreach (string anotherPath in selectedFilePaths) { string currentFileName = newFileNames[index++]; if (!string.IsNullOrEmpty(currentFileName)) { _RenamePackedFile(anotherPath, new FileInfo(currentFileName).Name); } } // Reloading is not needed as already done by _RenamePackedFile method // EVO_32 : message de réussite string message = string.Format(_STATUS_REPLACE_RENAME_SUCCESS_MANY, modifiedCount); StatusBarLogManager.ShowEvent(this, message); Cursor = Cursors.Default; } } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { Cursor = Cursors.Default; } } }
private void viewResetAllButton_Click(object sender, EventArgs e) { // Click on 'Reset All...' button if (camSetDetailsListView.Items.Count > 0) { try { // Hood front _CustomizeCameraView(customCameraIdLabel.Text, Cameras.ViewType.Hood, customCameraIdLabel.Text, Cameras.ViewType.Hood, true); // Hood back _CustomizeCameraView(customCameraIdLabel.Text, Cameras.ViewType.Hood, customCameraIdLabel.Text, Cameras.ViewType.Hood_Back, false); // Cockpit front _CustomizeCameraView(customCameraIdLabel.Text, Cameras.ViewType.Cockpit, customCameraIdLabel.Text, Cameras.ViewType.Cockpit, true); // Cockpit back _CustomizeCameraView(customCameraIdLabel.Text, Cameras.ViewType.Cockpit, customCameraIdLabel.Text, Cameras.ViewType.Cockpit_Back, false); // Refresh _RefreshCameraIKContents(); // Modification flag _IsCameraModified = true; StatusBarLogManager.ShowEvent(this, _STATUS_RESETTING_VIEW_OK); } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } finally { Cursor = Cursors.Default; } } }
/// <summary> /// Actualise l'arborescence /// </summary> private void _RefreshTreeView() { // On efface tout folderTreeView.Nodes.Clear(); bnkStatusLabel.Text = bnkStatusLabelCountSize.Text = ""; StatusBarLogManager.ShowEvent(this, _STATUS_NO_BNK_SELECTED); // Le dossier des bnk est-il valide ? DirectoryInfo di = new DirectoryInfo(LibraryConstants.GetSpecialFolder(LibraryConstants.TduSpecialFolder.Bnk)); if (!di.Exists) { // On efface tout bnkListView.Items.Clear(); _ClearContentLists(); MessageBoxes.ShowError(this, _ERROR_INVALID_TDU_PATH); return; } Cursor = Cursors.WaitCursor; // Noeud racine TreeNode rootNode = new TreeNode(_TREENODE_ROOT) { Tag = LibraryConstants.GetSpecialFolder(LibraryConstants.TduSpecialFolder.Bnk), ImageIndex = (int)ItemPictures.ClosedFolder, SelectedImageIndex = (int)ItemPictures.OpenedFolder }; folderTreeView.Nodes.Add(rootNode); // Parcours des dossiers try { _AddFoldersToTreeView(rootNode); // On déploie le noeud racine rootNode.Expand(); Cursor = Cursors.Default; } catch (Exception ex) { MessageBoxes.ShowError(this, ex); } }