private void OnSaveAsWithEncoding() { var newEncoding = CodePageList[SelectedCodePageIndex]; ShowCodePageList = false; bool isSaved = CurrentEditor?.SaveFile(saveAs: true, newEncoding: newEncoding.GetEncoding()) == true; if (isSaved) { CodePageChangedEvent?.Invoke(); CurrentEditor.Load(CurrentEditor.CurrentFilePath); // reload with new encoding } }
private void OnReloadFileWithCodePage() { if (CurrentEditor == null) { return; } if (CurrentEditor.IsModified == true) { var result = MessageBox.Show(Application.Current.MainWindow, Properties.Resources.Message_ConfirmReloadFileMessage, Properties.Resources.Message_ConfirmReloadFileTitle, MessageBoxButton.OKCancel, MessageBoxImage.Question); if (result != MessageBoxResult.OK) { return; } } var newEncoding = CodePageList[SelectedCodePageIndex]; CurrentEditor.Load(CurrentEditor.CurrentFilePath, newEncoding.GetEncoding()); CodePageChangedEvent?.Invoke(); }