diff --git a/Application/FileConverter/ConversionJobs/ConversionJob_ExtractCDA.cs b/Application/FileConverter/ConversionJobs/ConversionJob_ExtractCDA.cs index 5adcc3c..187c0c1 100644 --- a/Application/FileConverter/ConversionJobs/ConversionJob_ExtractCDA.cs +++ b/Application/FileConverter/ConversionJobs/ConversionJob_ExtractCDA.cs @@ -37,7 +37,14 @@ namespace FileConverter.ConversionJobs return InputPostConversionAction.None; } } - + + public override void Cancel() + { + base.Cancel(); + + this.compressionConversionJob.Cancel(); + } + protected override void Initialize() { base.Initialize(); @@ -188,13 +195,6 @@ namespace FileConverter.ConversionJobs File.Delete(this.intermediateFilePath); } - public override void Cancel() - { - base.Cancel(); - - this.compressionConversionJob.Cancel(); - } - private void WriteWaveData(object sender, DataReadEventArgs eventArgs) { this.waveWriter?.Write(eventArgs.Data, 0, (int)eventArgs.DataSize); diff --git a/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.Converters.cs b/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.Converters.cs index a2e3210..4862d7e 100644 --- a/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.Converters.cs +++ b/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.Converters.cs @@ -197,7 +197,7 @@ namespace FileConverter.ConversionJobs } /// - /// Convert video quality index to lib theora video quality level. + /// Convert video quality index to lib theora video quality level. /// /// The quality index. /// Returns the video quality index. diff --git a/Application/FileConverter/ConversionJobs/ConversionJob_ImageMagick.cs b/Application/FileConverter/ConversionJobs/ConversionJob_ImageMagick.cs index 8e2d7d7..99b779b 100644 --- a/Application/FileConverter/ConversionJobs/ConversionJob_ImageMagick.cs +++ b/Application/FileConverter/ConversionJobs/ConversionJob_ImageMagick.cs @@ -87,7 +87,7 @@ namespace FileConverter.ConversionJobs float scaleFactor = this.ConversionPreset.GetSettingsValue(ConversionPreset.ConversionSettingKeys.ImageScale); if (Math.Abs(scaleFactor - 1f) >= 0.005f) { - Debug.Log("Apply scale factor: {0}%.", scaleFactor*100); + Debug.Log("Apply scale factor: {0}%.", scaleFactor * 100); dpi *= scaleFactor; } @@ -126,9 +126,9 @@ namespace FileConverter.ConversionJobs float scaleFactor = this.ConversionPreset.GetSettingsValue(ConversionPreset.ConversionSettingKeys.ImageScale); if (Math.Abs(scaleFactor - 1f) >= 0.005f) { - Debug.Log("Apply scale factor: {0}%.", scaleFactor*100); + Debug.Log("Apply scale factor: {0}%.", scaleFactor * 100); - image.Scale(new Percentage(scaleFactor*100f)); + image.Scale(new Percentage(scaleFactor * 100f)); } } @@ -150,7 +150,7 @@ namespace FileConverter.ConversionJobs { int referenceSize = System.Math.Min(image.Width, image.Height); int size = 2; - while (size*2 <= referenceSize) + while (size * 2 <= referenceSize) { size *= 2; } @@ -208,7 +208,7 @@ namespace FileConverter.ConversionJobs } float alreadyCompletedPages = this.CurrentOuputFilePathIndex / (float)this.pageCount; - this.Progress = alreadyCompletedPages + (float)eventArgs.Progress.ToDouble() / (100f * this.pageCount); + this.Progress = alreadyCompletedPages + ((float)eventArgs.Progress.ToDouble() / (100f * this.pageCount)); } } } diff --git a/Application/FileConverter/ConversionJobs/ConversionJob_Word.cs b/Application/FileConverter/ConversionJobs/ConversionJob_Word.cs index e30bfe9..67dc1f4 100644 --- a/Application/FileConverter/ConversionJobs/ConversionJob_Word.cs +++ b/Application/FileConverter/ConversionJobs/ConversionJob_Word.cs @@ -1,4 +1,4 @@ -// License: http://www.gnu.org/licenses/gpl.html GPL version 3. +// License: http://www.gnu.org/licenses/gpl.html GPL version 3. namespace FileConverter.ConversionJobs { diff --git a/Application/FileConverter/FileConverter.csproj b/Application/FileConverter/FileConverter.csproj index bd8b04b..43909ef 100644 --- a/Application/FileConverter/FileConverter.csproj +++ b/Application/FileConverter/FileConverter.csproj @@ -137,11 +137,13 @@ Resources.fr.resx True True + True Resources.en.resx True True + True diff --git a/Application/FileConverter/Helpers.cs b/Application/FileConverter/Helpers.cs index d797a84..11be8b5 100644 --- a/Application/FileConverter/Helpers.cs +++ b/Application/FileConverter/Helpers.cs @@ -14,13 +14,13 @@ namespace FileConverter { public static IEnumerable GetSupportedCultures() { - //Get all culture + // Get all cultures. CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); - //Find the location where application installed. + // Find the location where application installed. string exeLocation = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path)); - //Return all culture for which satellite folder found with culture code. + // Return all culture for which satellite folder found with culture code. return cultures.Where(cultureInfo => Directory.Exists(Path.Combine(exeLocation, "Languages", cultureInfo.Name))); } diff --git a/Application/FileConverter/PathHelpers.cs b/Application/FileConverter/PathHelpers.cs index d4e67b3..bf8a484 100644 --- a/Application/FileConverter/PathHelpers.cs +++ b/Application/FileConverter/PathHelpers.cs @@ -3,8 +3,8 @@ namespace FileConverter { using System; - using System.Text; using System.Collections.Generic; + using System.Text; using System.Text.RegularExpressions; using FileConverter.Diagnostics; diff --git a/Application/FileConverter/Settings.Settings.cs b/Application/FileConverter/Settings.Settings.cs index 5d3f582..022700d 100644 --- a/Application/FileConverter/Settings.Settings.cs +++ b/Application/FileConverter/Settings.Settings.cs @@ -1,12 +1,9 @@ // License: http://www.gnu.org/licenses/gpl.html GPL version 3. -using System.Globalization; -using System.Windows; -using System.Windows.Markup; - namespace FileConverter { using System.Collections.ObjectModel; + using System.Globalization; using System.Linq; using System.Xml.Serialization; diff --git a/Application/FileConverter/Upgrade/Helpers.cs b/Application/FileConverter/Upgrade/Helpers.cs index dfcb2b4..8d10032 100644 --- a/Application/FileConverter/Upgrade/Helpers.cs +++ b/Application/FileConverter/Upgrade/Helpers.cs @@ -128,7 +128,7 @@ namespace FileConverter.Upgrade Helpers.currentlyDownloadedVersionDescription = upgradeVersionDescription; Helpers.webClient.DownloadProgressChanged += Helpers.WebClient_DownloadProgressChanged; - Helpers.webClient.DownloadFileCompleted += Helpers.WebClient_DownloadFileCompleted; ; + Helpers.webClient.DownloadFileCompleted += Helpers.WebClient_DownloadFileCompleted; Task downloadTask = Helpers.webClient.DownloadFileTaskAsync(uri, installerPath); } diff --git a/Application/FileConverter/Upgrade/UpgradeVersionDescription.cs b/Application/FileConverter/Upgrade/UpgradeVersionDescription.cs index 081d403..844f0e9 100644 --- a/Application/FileConverter/Upgrade/UpgradeVersionDescription.cs +++ b/Application/FileConverter/Upgrade/UpgradeVersionDescription.cs @@ -1,17 +1,18 @@ // License: http://www.gnu.org/licenses/gpl.html GPL version 3. -using System.ComponentModel; -using System.Runtime.CompilerServices; -using FileConverter.Annotations; - namespace FileConverter { + using System.ComponentModel; + using System.Runtime.CompilerServices; using System.Xml.Serialization; + using FileConverter.Annotations; + public class UpgradeVersionDescription : INotifyPropertyChanged { private int installerDownloadProgress; private bool installerDownloadInProgress; + public event PropertyChangedEventHandler PropertyChanged; [XmlElement("Latest")] diff --git a/Application/FileConverter/ValueConverters/Generic/CultureInfoToStringConverter.cs b/Application/FileConverter/ValueConverters/Generic/CultureInfoToStringConverter.cs index 76798ba..640fa07 100644 --- a/Application/FileConverter/ValueConverters/Generic/CultureInfoToStringConverter.cs +++ b/Application/FileConverter/ValueConverters/Generic/CultureInfoToStringConverter.cs @@ -1,4 +1,4 @@ -// License: http://www.gnu.org/licenses/gpl.html GPL version 3. +// License: http://www.gnu.org/licenses/gpl.html GPL version 3. namespace FileConverter.ValueConverters.Generic { @@ -27,7 +27,7 @@ namespace FileConverter.ValueConverters.Generic return nativeName.ToUpper(cultureInfo); } - return nativeName.Substring(0, 1).ToUpper(cultureInfo) + nativeName.Substring(1, nativeName.Length - 1); ; + return nativeName.Substring(0, 1).ToUpper(cultureInfo) + nativeName.Substring(1, nativeName.Length - 1); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Application/FileConverter/ValueConverters/Generic/ObjectToLocalizedString.cs b/Application/FileConverter/ValueConverters/Generic/ObjectToLocalizedString.cs index 434a55e..e7e6edd 100644 --- a/Application/FileConverter/ValueConverters/Generic/ObjectToLocalizedString.cs +++ b/Application/FileConverter/ValueConverters/Generic/ObjectToLocalizedString.cs @@ -1,4 +1,4 @@ -// License: http://www.gnu.org/licenses/gpl.html GPL version 3. +// License: http://www.gnu.org/licenses/gpl.html GPL version 3. namespace FileConverter.ValueConverters.Generic { diff --git a/Application/FileConverter/ValueConverters/OutputTypeEnumToViewModel.cs b/Application/FileConverter/ValueConverters/OutputTypeEnumToViewModel.cs index 377665c..caa05ee 100644 --- a/Application/FileConverter/ValueConverters/OutputTypeEnumToViewModel.cs +++ b/Application/FileConverter/ValueConverters/OutputTypeEnumToViewModel.cs @@ -1,11 +1,12 @@ -// License: http://www.gnu.org/licenses/gpl.html GPL version 3. +// License: http://www.gnu.org/licenses/gpl.html GPL version 3. namespace FileConverter.ValueConverters { using System; using System.Globalization; - using System.Windows.Data; using System.Linq; + using System.Windows.Data; + using FileConverter.Windows; public class OutputTypeEnumToViewModel : IValueConverter diff --git a/Application/FileConverter/Windows/MainWindow.xaml.cs b/Application/FileConverter/Windows/MainWindow.xaml.cs index 70f2514..0e6fe95 100644 --- a/Application/FileConverter/Windows/MainWindow.xaml.cs +++ b/Application/FileConverter/Windows/MainWindow.xaml.cs @@ -147,7 +147,7 @@ namespace FileConverter else if (this.upgradeWindow == null) { this.upgradeWindow = new UpgradeWindow(); - this.upgradeWindow.Closed += UpgradeWindow_Closed; + this.upgradeWindow.Closed += this.UpgradeWindow_Closed; } Application application = Application.Current as Application; diff --git a/Application/FileConverter/Windows/OutputTypeViewModel.cs b/Application/FileConverter/Windows/OutputTypeViewModel.cs index 0f46b96..ffe7d01 100644 --- a/Application/FileConverter/Windows/OutputTypeViewModel.cs +++ b/Application/FileConverter/Windows/OutputTypeViewModel.cs @@ -1,4 +1,4 @@ -// License: http://www.gnu.org/licenses/gpl.html GPL version 3. +// License: http://www.gnu.org/licenses/gpl.html GPL version 3. namespace FileConverter.Windows { diff --git a/Application/FileConverter/Windows/SettingsWindow.xaml.cs b/Application/FileConverter/Windows/SettingsWindow.xaml.cs index 8d962da..78d163f 100644 --- a/Application/FileConverter/Windows/SettingsWindow.xaml.cs +++ b/Application/FileConverter/Windows/SettingsWindow.xaml.cs @@ -13,10 +13,10 @@ namespace FileConverter using System.Windows.Data; using System.Windows.Input; - using FileConverter.Windows; using FileConverter.Annotations; using FileConverter.Commands; using FileConverter.ConversionJobs; + using FileConverter.Windows; using Microsoft.Win32; /// @@ -57,6 +57,25 @@ namespace FileConverter public event EventHandler OnSettingsWindowHide; + public static OutputTypeViewModel[] OutputTypeViewModels => new[] + { + new OutputTypeViewModel(OutputType.Ogg), + new OutputTypeViewModel(OutputType.Mp3), + new OutputTypeViewModel(OutputType.Aac), + new OutputTypeViewModel(OutputType.Flac), + new OutputTypeViewModel(OutputType.Wav), + new OutputTypeViewModel(OutputType.Mkv), + new OutputTypeViewModel(OutputType.Mp4), + new OutputTypeViewModel(OutputType.Ogv), + new OutputTypeViewModel(OutputType.Webm), + new OutputTypeViewModel(OutputType.Avi), + new OutputTypeViewModel(OutputType.Png), + new OutputTypeViewModel(OutputType.Jpg), + new OutputTypeViewModel(OutputType.Ico), + new OutputTypeViewModel(OutputType.Gif), + new OutputTypeViewModel(OutputType.Pdf), + }; + public ICommand OpenUrlCommand { get @@ -148,26 +167,7 @@ namespace FileConverter get; set; } - - public static OutputTypeViewModel[] OutputTypeViewModels => new[] - { - new OutputTypeViewModel(OutputType.Ogg), - new OutputTypeViewModel(OutputType.Mp3), - new OutputTypeViewModel(OutputType.Aac), - new OutputTypeViewModel(OutputType.Flac), - new OutputTypeViewModel(OutputType.Wav), - new OutputTypeViewModel(OutputType.Mkv), - new OutputTypeViewModel(OutputType.Mp4), - new OutputTypeViewModel(OutputType.Ogv), - new OutputTypeViewModel(OutputType.Webm), - new OutputTypeViewModel(OutputType.Avi), - new OutputTypeViewModel(OutputType.Png), - new OutputTypeViewModel(OutputType.Jpg), - new OutputTypeViewModel(OutputType.Ico), - new OutputTypeViewModel(OutputType.Gif), - new OutputTypeViewModel(OutputType.Pdf), - }; - + public InputPostConversionAction[] InputPostConversionActions => new[] { InputPostConversionAction.None, diff --git a/Application/FileConverter/Windows/UpgradeWindow.xaml.cs b/Application/FileConverter/Windows/UpgradeWindow.xaml.cs index 6cd43ea..3bbad11 100644 --- a/Application/FileConverter/Windows/UpgradeWindow.xaml.cs +++ b/Application/FileConverter/Windows/UpgradeWindow.xaml.cs @@ -2,12 +2,11 @@ namespace FileConverter.Windows { - using System; - using System.Windows.Input; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading.Tasks; using System.Windows; + using System.Windows.Input; using FileConverter.Annotations; using FileConverter.Commands;