This commit is contained in:
Tichau committed 2016-09-07 08:25:41 +02:00
1 parent 569dedcf65
commit 1513aa19df
17 files changed
+58 -58

No files matched your search

@@ -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);
@@ -197,7 +197,7 @@ namespace FileConverter.ConversionJobs
}
/// <summary>
/// Convert video quality index to lib theora video quality level.
/// Convert video quality index to lib <c>theora</c> video quality level.
/// </summary>
/// <param name="quality">The quality index.</param>
/// <returns>Returns the video quality index.</returns>
@@ -87,7 +87,7 @@ namespace FileConverter.ConversionJobs
float scaleFactor = this.ConversionPreset.GetSettingsValue<float>(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<float>(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));
}
}
}
@@ -1,4 +1,4 @@
// <copyright file="ConversionJob_ImageMagick.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
// <copyright file="ConversionJob_Word.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter.ConversionJobs
{
@@ -137,11 +137,13 @@
<DependentUpon>Resources.fr.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<ExcludeFromStyleCop>True</ExcludeFromStyleCop>
</Compile>
<Compile Include="Properties\Resources.en.Designer.cs">
<DependentUpon>Resources.en.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<ExcludeFromStyleCop>True</ExcludeFromStyleCop>
</Compile>
<Compile Include="Registry.cs" />
<Compile Include="Settings.Migration.cs" />
+3 -3
View File
@@ -14,13 +14,13 @@ namespace FileConverter
{
public static IEnumerable<CultureInfo> 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)));
}
+1 -1
View File
@@ -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;
@@ -1,12 +1,9 @@
// <copyright file="Settings.Settings.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
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;
+1 -1
View File
@@ -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);
}
@@ -1,17 +1,18 @@
// <copyright file="UpgradeVersionDescription.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
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")]
@@ -1,4 +1,4 @@
// <copyright file="BoolInverterConverter.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
// <copyright file="CultureInfoToStringConverter.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
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)
@@ -1,4 +1,4 @@
// <copyright file="BoolInverterConverter.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
// <copyright file="ObjectToLocalizedString.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter.ValueConverters.Generic
{
@@ -1,11 +1,12 @@
// <copyright file="BitrateToString.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
// <copyright file="OutputTypeEnumToViewModel.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
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
@@ -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;
@@ -1,4 +1,4 @@
// <copyright file="OutputFileType.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
// <copyright file="OutputTypeViewModel.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter.Windows
{
@@ -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;
/// <summary>
@@ -57,6 +57,25 @@ namespace FileConverter
public event EventHandler<EventArgs> 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,
@@ -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;