Initial project commit
This commit is contained in:
parent
478627d8b3
commit
714ead809c
6
Application/FileConverter/App.config
Normal file
6
Application/FileConverter/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
8
Application/FileConverter/Application.xaml
Normal file
8
Application/FileConverter/Application.xaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<Application x:Class="FileConverter.Application"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose">
|
||||||
|
<Application.Resources>
|
||||||
|
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
188
Application/FileConverter/Application.xaml.cs
Normal file
188
Application/FileConverter/Application.xaml.cs
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
// <copyright file="Application.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||||
|
|
||||||
|
namespace FileConverter
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
public partial class Application : System.Windows.Application
|
||||||
|
{
|
||||||
|
private readonly List<ConversionJob> conversionJobs = new List<ConversionJob>();
|
||||||
|
|
||||||
|
private bool debugMode;
|
||||||
|
private bool initialized;
|
||||||
|
|
||||||
|
public Application()
|
||||||
|
{
|
||||||
|
this.Initialize();
|
||||||
|
|
||||||
|
if (this.initialized)
|
||||||
|
{
|
||||||
|
Thread fileConvertionThread = new Thread(this.ConvertFiles);
|
||||||
|
fileConvertionThread.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReadOnlyCollection<ConversionJob> ConvertionJobs
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Verbose
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Initialize()
|
||||||
|
{
|
||||||
|
this.ConvertionJobs = this.conversionJobs.AsReadOnly();
|
||||||
|
|
||||||
|
Diagnostics.Log("Retrieve arguments...");
|
||||||
|
string[] args = Environment.GetCommandLineArgs();
|
||||||
|
|
||||||
|
if (args.Length <= 1)
|
||||||
|
{
|
||||||
|
this.debugMode = true;
|
||||||
|
System.Array.Resize(ref args, 9);
|
||||||
|
args[1] = "--output-type";
|
||||||
|
args[2] = "mp3";
|
||||||
|
args[3] = @"D:\Projects\FileConverter\TestFiles\Herbie Hancock - Speak Like A Child [RVG Edition].flac";
|
||||||
|
args[4] = @"D:\Projects\FileConverter\TestFiles\test\Toccata.wav";
|
||||||
|
args[5] = @"D:\Projects\FileConverter\TestFiles\test\Toccata - Copie (4).wav";
|
||||||
|
//// args[5] = "--verbose";
|
||||||
|
args[6] = @"D:\Projects\FileConverter\TestFiles\test\Toccata - Copie (3).wav";
|
||||||
|
args[7] = @"D:\Projects\FileConverter\TestFiles\test\Toccata - Copie (2).wav";
|
||||||
|
args[8] = @"D:\Projects\FileConverter\TestFiles\test\Toccata - Copie (5).wav";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int index = 0; index < args.Length; index++)
|
||||||
|
{
|
||||||
|
string argument = args[index];
|
||||||
|
Diagnostics.Log("Arg{0}: {1}", index, argument);
|
||||||
|
}
|
||||||
|
|
||||||
|
Diagnostics.Log(string.Empty);
|
||||||
|
|
||||||
|
OutputType outputType = OutputType.None;
|
||||||
|
List<string> filePaths = new List<string>();
|
||||||
|
for (int index = 1; index < args.Length; index++)
|
||||||
|
{
|
||||||
|
string argument = args[index];
|
||||||
|
if (argument.StartsWith("--"))
|
||||||
|
{
|
||||||
|
// This is an optional parameter.
|
||||||
|
string parameterTitle = argument.Substring(2).ToLowerInvariant();
|
||||||
|
|
||||||
|
switch (parameterTitle)
|
||||||
|
{
|
||||||
|
case "output-type":
|
||||||
|
{
|
||||||
|
if (index >= args.Length - 1)
|
||||||
|
{
|
||||||
|
Diagnostics.Log("ERROR ! Invalid format.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string outputTypeName = args[index + 1].ToLowerInvariant();
|
||||||
|
switch (outputTypeName)
|
||||||
|
{
|
||||||
|
case "mp3":
|
||||||
|
outputType = OutputType.Mp3;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "ogg":
|
||||||
|
outputType = OutputType.Ogg;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "flac":
|
||||||
|
outputType = OutputType.Flac;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Diagnostics.Log("ERROR ! Unknown output type {0}.", outputType);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
index++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
case "verbose":
|
||||||
|
{
|
||||||
|
this.Verbose = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Diagnostics.Log("ERROR ! Unknown option {0}.", parameterTitle);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filePaths.Add(argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (outputType == OutputType.None)
|
||||||
|
{
|
||||||
|
Diagnostics.Log("ERROR ! Can't retrieve the output type from arguments.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create convertion jobs.
|
||||||
|
for (int index = 0; index < filePaths.Count; index++)
|
||||||
|
{
|
||||||
|
ConversionJob conversionJob = new ConversionJob();
|
||||||
|
|
||||||
|
string inputFilePath = filePaths[index];
|
||||||
|
string extension = System.IO.Path.GetExtension(inputFilePath);
|
||||||
|
string outputFilePath = inputFilePath.Substring(0, inputFilePath.Length - extension.Length) + "."
|
||||||
|
+ outputType.ToString().ToLowerInvariant();
|
||||||
|
|
||||||
|
conversionJob.Initialize(outputType, inputFilePath, outputFilePath);
|
||||||
|
|
||||||
|
this.conversionJobs.Add(conversionJob);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConvertFiles()
|
||||||
|
{
|
||||||
|
for (int index = 0; index < this.conversionJobs.Count; index++)
|
||||||
|
{
|
||||||
|
ConversionJob conversionJob = this.conversionJobs[index];
|
||||||
|
conversionJob.StartConvertion();
|
||||||
|
|
||||||
|
if (System.IO.File.Exists(conversionJob.OutputFilePath))
|
||||||
|
{
|
||||||
|
Diagnostics.Log("Success!");
|
||||||
|
|
||||||
|
if (this.debugMode)
|
||||||
|
{
|
||||||
|
Diagnostics.Log("Delete file {0}.", conversionJob.OutputFilePath);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
System.IO.File.Delete(conversionJob.OutputFilePath);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Diagnostics.Log("Fail!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Diagnostics.Log("End of job queue.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
257
Application/FileConverter/ConversionJob.cs
Normal file
257
Application/FileConverter/ConversionJob.cs
Normal file
@ -0,0 +1,257 @@
|
|||||||
|
// <copyright file="ConversionJob.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||||
|
|
||||||
|
namespace FileConverter
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
public class ConversionJob : INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
private readonly Regex durationRegex = new Regex(@"Duration: ([0-9][0-9]):([0-9][0-9]):([0-9][0-9])\.([0-9][0-9]), bitrate: ([0-9]+) kb\/s");
|
||||||
|
private readonly Regex progressRegex = new Regex(@"size=[ ]*([0-9]+)kB time=([0-9][0-9]):([0-9][0-9]):([0-9][0-9]).([0-9][0-9]) bitrate= ([0-9]+.[0-9])kbits\/s");
|
||||||
|
|
||||||
|
private TimeSpan fileDuration;
|
||||||
|
private TimeSpan actualConvertedDuration;
|
||||||
|
|
||||||
|
private ProcessStartInfo ffmpegProcessStartInfo;
|
||||||
|
|
||||||
|
private float progress;
|
||||||
|
|
||||||
|
private ConversionState state;
|
||||||
|
|
||||||
|
private string exitingMessage;
|
||||||
|
|
||||||
|
public ConversionJob()
|
||||||
|
{
|
||||||
|
this.OutputType = OutputType.None;
|
||||||
|
this.progress = 0f;
|
||||||
|
this.InputFilePath = string.Empty;
|
||||||
|
this.OutputFilePath = string.Empty;
|
||||||
|
this.State = ConversionState.Unknown;
|
||||||
|
this.ExitingMessage = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
public enum ConversionState
|
||||||
|
{
|
||||||
|
Unknown,
|
||||||
|
|
||||||
|
Ready,
|
||||||
|
InProgress,
|
||||||
|
Done,
|
||||||
|
Failed,
|
||||||
|
}
|
||||||
|
|
||||||
|
public string InputFilePath
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string OutputFilePath
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OutputType OutputType
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConversionState State
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.state;
|
||||||
|
}
|
||||||
|
|
||||||
|
private set
|
||||||
|
{
|
||||||
|
this.state = value;
|
||||||
|
this.NotifyPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Progress
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
private set
|
||||||
|
{
|
||||||
|
this.progress = value;
|
||||||
|
this.NotifyPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ExitingMessage
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.exitingMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.exitingMessage = value;
|
||||||
|
this.NotifyPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Initialize(OutputType outputType, string inputFileName, string outputFileName)
|
||||||
|
{
|
||||||
|
if (outputType == OutputType.None)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("The output type must be valid.", "outputType");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.OutputType = outputType;
|
||||||
|
this.ffmpegProcessStartInfo = null;
|
||||||
|
|
||||||
|
string applicationDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||||
|
string ffmpegPath = string.Format("{0}\\ffmpeg.exe", applicationDirectory);
|
||||||
|
if (!System.IO.File.Exists(ffmpegPath))
|
||||||
|
{
|
||||||
|
Diagnostics.Log("Can't find ffmpeg executable ({0}). Try to reinstall the application.", ffmpegPath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.ffmpegProcessStartInfo = new ProcessStartInfo(ffmpegPath);
|
||||||
|
|
||||||
|
this.ffmpegProcessStartInfo.CreateNoWindow = true;
|
||||||
|
this.ffmpegProcessStartInfo.UseShellExecute = false;
|
||||||
|
this.ffmpegProcessStartInfo.RedirectStandardOutput = true;
|
||||||
|
this.ffmpegProcessStartInfo.RedirectStandardError = true;
|
||||||
|
|
||||||
|
this.InputFilePath = inputFileName;
|
||||||
|
this.OutputFilePath = outputFileName;
|
||||||
|
|
||||||
|
this.State = ConversionState.Ready;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartConvertion()
|
||||||
|
{
|
||||||
|
if (this.OutputType == OutputType.None)
|
||||||
|
{
|
||||||
|
throw new Exception("The converter is not initialized.");
|
||||||
|
}
|
||||||
|
|
||||||
|
Diagnostics.Log("Convert file {0} to {1}.", this.InputFilePath, this.OutputFilePath);
|
||||||
|
|
||||||
|
string arguments = string.Empty;
|
||||||
|
switch (this.OutputType)
|
||||||
|
{
|
||||||
|
case OutputType.Mp3:
|
||||||
|
arguments = string.Format("-n -i \"{0}\" -stats -ar 44100 -ab 320k -map_metadata 0:s:0 -id3v2_version 3 -write_id3v1 1 \"{1}\"", this.InputFilePath, this.OutputFilePath);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OutputType.Ogg:
|
||||||
|
arguments = string.Format("-n -i \"{0}\" -map_metadata 0:s:0 \"{1}\"", this.InputFilePath, this.OutputFilePath);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OutputType.Flac:
|
||||||
|
arguments = string.Format("-n -i \"{0}\" -map_metadata 0:s:0 \"{1}\"", this.InputFilePath, this.OutputFilePath);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(arguments) || this.ffmpegProcessStartInfo == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.State = ConversionState.InProgress;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Diagnostics.Log(string.Empty);
|
||||||
|
this.ffmpegProcessStartInfo.Arguments = arguments;
|
||||||
|
Diagnostics.Log("Execute command: {0} {1}.", this.ffmpegProcessStartInfo.FileName, this.ffmpegProcessStartInfo.Arguments);
|
||||||
|
using (Process exeProcess = Process.Start(this.ffmpegProcessStartInfo))
|
||||||
|
{
|
||||||
|
using (StreamReader reader = exeProcess.StandardError)
|
||||||
|
{
|
||||||
|
while (!reader.EndOfStream)
|
||||||
|
{
|
||||||
|
string result = reader.ReadLine();
|
||||||
|
|
||||||
|
this.ParseFFMPEGOutput(result);
|
||||||
|
|
||||||
|
Diagnostics.Log("ffmpeg output: {0}", result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exeProcess.WaitForExit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
this.State = ConversionState.Failed;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.progress < 1f)
|
||||||
|
{
|
||||||
|
this.State = ConversionState.Failed;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.State = ConversionState.Done;
|
||||||
|
|
||||||
|
Diagnostics.Log("\nDone!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ParseFFMPEGOutput(string input)
|
||||||
|
{
|
||||||
|
Match match = this.durationRegex.Match(input);
|
||||||
|
if (match.Success && match.Groups.Count >= 6)
|
||||||
|
{
|
||||||
|
int hours = int.Parse(match.Groups[1].Value);
|
||||||
|
int minutes = int.Parse(match.Groups[2].Value);
|
||||||
|
int seconds = int.Parse(match.Groups[3].Value);
|
||||||
|
int milliseconds = int.Parse(match.Groups[4].Value);
|
||||||
|
float bitrate = float.Parse(match.Groups[5].Value);
|
||||||
|
this.fileDuration = new TimeSpan(0, hours, minutes, seconds, milliseconds);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
match = this.progressRegex.Match(input);
|
||||||
|
if (match.Success && match.Groups.Count >= 7)
|
||||||
|
{
|
||||||
|
int size = int.Parse(match.Groups[1].Value);
|
||||||
|
int hours = int.Parse(match.Groups[2].Value);
|
||||||
|
int minutes = int.Parse(match.Groups[3].Value);
|
||||||
|
int seconds = int.Parse(match.Groups[4].Value);
|
||||||
|
int milliseconds = int.Parse(match.Groups[5].Value);
|
||||||
|
float bitrate = 0f;
|
||||||
|
float.TryParse(match.Groups[6].Value, out bitrate);
|
||||||
|
|
||||||
|
this.actualConvertedDuration = new TimeSpan(0, hours, minutes, seconds, milliseconds);
|
||||||
|
|
||||||
|
this.Progress = this.actualConvertedDuration.Ticks / (float)this.fileDuration.Ticks;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input.Contains("Exiting."))
|
||||||
|
{
|
||||||
|
this.ExitingMessage = input;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
|
||||||
|
{
|
||||||
|
if (this.PropertyChanged != null)
|
||||||
|
{
|
||||||
|
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
75
Application/FileConverter/ConversionStateToBrush.cs
Normal file
75
Application/FileConverter/ConversionStateToBrush.cs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// <copyright file="ConversionStateToBrush.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||||
|
|
||||||
|
namespace FileConverter
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
public class ConversionStateToBrush : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (!(value is ConversionJob.ConversionState))
|
||||||
|
{
|
||||||
|
throw new ArgumentException("The value must be a conversion state.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ConversionJob.ConversionState conversionState = (ConversionJob.ConversionState)value;
|
||||||
|
string type = parameter as string;
|
||||||
|
|
||||||
|
if (type == "Background")
|
||||||
|
{
|
||||||
|
switch (conversionState)
|
||||||
|
{
|
||||||
|
case ConversionJob.ConversionState.Unknown:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(230, 230, 230));
|
||||||
|
|
||||||
|
case ConversionJob.ConversionState.Ready:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(230, 230, 230));
|
||||||
|
|
||||||
|
case ConversionJob.ConversionState.InProgress:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(250, 236, 179));
|
||||||
|
|
||||||
|
case ConversionJob.ConversionState.Done:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(200, 230, 201));
|
||||||
|
|
||||||
|
case ConversionJob.ConversionState.Failed:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(255, 205, 210));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (type == "Foreground")
|
||||||
|
{
|
||||||
|
switch (conversionState)
|
||||||
|
{
|
||||||
|
case ConversionJob.ConversionState.Unknown:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(128, 128, 128));
|
||||||
|
|
||||||
|
case ConversionJob.ConversionState.Ready:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(32, 32, 32));
|
||||||
|
|
||||||
|
case ConversionJob.ConversionState.InProgress:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(255, 160, 0));
|
||||||
|
|
||||||
|
case ConversionJob.ConversionState.Done:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(56, 142, 60));
|
||||||
|
|
||||||
|
case ConversionJob.ConversionState.Failed:
|
||||||
|
return new SolidColorBrush(Color.FromRgb(255, 82, 82));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new SystemException("Unknown type.");
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new SystemException("Unknown state.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
41
Application/FileConverter/Diagnostics.cs
Normal file
41
Application/FileConverter/Diagnostics.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// <copyright file="Diagnostics.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||||
|
|
||||||
|
namespace FileConverter
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
public static class Diagnostics
|
||||||
|
{
|
||||||
|
private static List<string> logMessages = new List<string>();
|
||||||
|
private static StringBuilder workingStringBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;
|
||||||
|
|
||||||
|
public static string Content
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
workingStringBuilder.Clear();
|
||||||
|
for (int index = 0; index < logMessages.Count; index++)
|
||||||
|
{
|
||||||
|
workingStringBuilder.AppendLine(logMessages[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return workingStringBuilder.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Log(string message, params object[] arguments)
|
||||||
|
{
|
||||||
|
Diagnostics.logMessages.Add(string.Format(message, arguments));
|
||||||
|
|
||||||
|
if (StaticPropertyChanged != null)
|
||||||
|
{
|
||||||
|
StaticPropertyChanged(null, new PropertyChangedEventArgs("Content"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
119
Application/FileConverter/FileConverter.csproj
Normal file
119
Application/FileConverter/FileConverter.csproj
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>FileConverter</RootNamespace>
|
||||||
|
<AssemblyName>FileConverter</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Accessibility" />
|
||||||
|
<Reference Include="PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||||
|
<Reference Include="ReachFramework" />
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Printing" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="System.Xaml">
|
||||||
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UIAutomationProvider" />
|
||||||
|
<Reference Include="UIAutomationTypes" />
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ApplicationDefinition Include="Application.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</ApplicationDefinition>
|
||||||
|
<Page Include="MainWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Compile Include="Application.xaml.cs">
|
||||||
|
<DependentUpon>Application.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ConversionStateToBrush.cs" />
|
||||||
|
<Compile Include="ConversionJob.cs" />
|
||||||
|
<Compile Include="Diagnostics.cs" />
|
||||||
|
<Compile Include="MainWindow.xaml.cs">
|
||||||
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="OutputType.cs" />
|
||||||
|
<Compile Include="Properties\Annotations.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<AppDesigner Include="Properties\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="ReadMe.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
54
Application/FileConverter/FileConverter.sln
Normal file
54
Application/FileConverter/FileConverter.sln
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 2012
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileConverter", "FileConverter.csproj", "{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}"
|
||||||
|
EndProject
|
||||||
|
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Installer", "..\..\Installer\Installer.wixproj", "{F14673DF-DF38-44B4-AB1D-99A59182C24C}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileConverterExtension", "..\FileConverterExtension\FileConverterExtension.csproj", "{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|Mixed Platforms = Release|Mixed Platforms
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
|
{D27A76D2-43E4-43CC-9DA3-334B0B46F4E5}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|Any CPU.ActiveCfg = Release|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{F14673DF-DF38-44B4-AB1D-99A59182C24C}.Release|x86.Build.0 = Release|x86
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
|
{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
8
Application/FileConverter/FileConverter.sln.DotSettings
Normal file
8
Application/FileConverter/FileConverter.sln.DotSettings
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=FileConverter_002EAnnotations/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1600/@EntryIndexedValue">HINT</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1601/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1602/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestUseVarKeywordEvident/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ABSTRACT_ACCESSORHOLDER_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>
|
78
Application/FileConverter/MainWindow.xaml
Normal file
78
Application/FileConverter/MainWindow.xaml
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<Window
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="FileConverter.MainWindow"
|
||||||
|
xmlns:local="clr-namespace:FileConverter"
|
||||||
|
x:Name="FileConverterMainWindow" Title="File Converter" Height="500" Width="950" MinHeight="250" MinWidth="450" WindowStartupLocation="CenterScreen">
|
||||||
|
<Window.Resources>
|
||||||
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
|
<local:ConversionStateToBrush x:Key="ConversionStateToColor" />
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
|
<Grid Margin="10">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="30" />
|
||||||
|
<RowDefinition Height="2*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid Grid.Row="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="100" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Label Name="Title" Grid.Column="0" Content="Files to convert" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold"/>
|
||||||
|
<Button Name="SettingsButton" Grid.Column="1" Content="Settings" Margin="0,3" Visibility="Hidden"></Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<ScrollViewer x:Name="ScrollViewer" Grid.Row="1" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
|
||||||
|
<ItemsControl Name="ConverterJobsList">
|
||||||
|
<ItemsControl.DataContext>
|
||||||
|
<local:ConversionJob/>
|
||||||
|
</ItemsControl.DataContext>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<DockPanel Background="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Background'}" Margin="0,4">
|
||||||
|
<Grid Margin="10">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="20" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2.5*" MinWidth="300" />
|
||||||
|
<ColumnDefinition Width="*" MinWidth="100" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding OutputFilePath}" FontWeight="Bold" />
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="1" Grid.Column="0" Margin="10,0,0,0">
|
||||||
|
<WrapPanel>
|
||||||
|
<TextBlock Text="Converted from " FontSize="11" FontStyle="Italic" />
|
||||||
|
<TextBlock Text="{Binding InputFilePath}" FontSize="11" FontStyle="Italic" />
|
||||||
|
</WrapPanel>
|
||||||
|
<TextBlock Text="{Binding ExitingMessage}" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding State}" FontWeight="Bold" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" />
|
||||||
|
|
||||||
|
<ProgressBar Grid.Row="1" Grid.Column="1" Height="18" Width="Auto" Minimum="0" Maximum="1" SmallChange="0.001" Value="{Binding Progress, Mode=OneWay}" Foreground="{Binding State, Converter={StaticResource ConversionStateToColor}, ConverterParameter='Foreground'}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" MinWidth="100" LargeChange="0.1" />
|
||||||
|
</Grid>
|
||||||
|
</DockPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<Grid Grid.Row="2" Visibility="{Binding VerboseMode, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=FileConverterMainWindow, Mode=OneWay}">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="30" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Label Grid.Row="0" Content="Log" VerticalAlignment="Top" Height="30" FontSize="16" FontWeight="Bold" />
|
||||||
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" CanContentScroll="True">
|
||||||
|
<TextBlock Name="Diagnostics" TextWrapping="NoWrap" Text="{Binding Path=(local:Diagnostics.Content), Mode=OneWay}" FontFamily="Consolas" Foreground="#FF272727"/>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
51
Application/FileConverter/MainWindow.xaml.cs
Normal file
51
Application/FileConverter/MainWindow.xaml.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// <copyright file="MainWindow.xaml.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||||
|
|
||||||
|
namespace FileConverter
|
||||||
|
{
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
using FileConverter.Annotations;
|
||||||
|
|
||||||
|
public partial class MainWindow : Window, INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
private bool verboseMode;
|
||||||
|
|
||||||
|
public MainWindow()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
|
||||||
|
Application application = Application.Current as Application;
|
||||||
|
|
||||||
|
this.ConverterJobsList.ItemsSource = application.ConvertionJobs;
|
||||||
|
this.VerboseMode = application.Verbose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
public bool VerboseMode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.verboseMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.verboseMode = value;
|
||||||
|
this.OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[NotifyPropertyChangedInvocator]
|
||||||
|
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||||
|
{
|
||||||
|
PropertyChangedEventHandler handler = this.PropertyChanged;
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new PropertyChangedEventArgs(propertyName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Application/FileConverter/OutputType.cs
Normal file
12
Application/FileConverter/OutputType.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// <copyright file="OutputType.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||||
|
|
||||||
|
namespace FileConverter
|
||||||
|
{
|
||||||
|
public enum OutputType
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Mp3,
|
||||||
|
Ogg,
|
||||||
|
Flac,
|
||||||
|
}
|
||||||
|
}
|
664
Application/FileConverter/Properties/Annotations.cs
Normal file
664
Application/FileConverter/Properties/Annotations.cs
Normal file
@ -0,0 +1,664 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007-2012 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace FileConverter.Annotations
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that marked element should be localized or not.
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// [LocalizationRequiredAttribute(true)]
|
||||||
|
/// public class Foo
|
||||||
|
/// {
|
||||||
|
/// private string str = "my string"; // Warning: Localizable string
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class LocalizationRequiredAttribute : Attribute
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LocalizationRequiredAttribute"/> class with
|
||||||
|
/// <see cref="Required"/> set to <see langword="true"/>.
|
||||||
|
/// </summary>
|
||||||
|
public LocalizationRequiredAttribute() : this(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LocalizationRequiredAttribute"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="required"><c>true</c> if a element should be localized; otherwise, <c>false</c>.</param>
|
||||||
|
public LocalizationRequiredAttribute(bool required)
|
||||||
|
{
|
||||||
|
Required = required;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether a element should be localized.
|
||||||
|
/// <value><c>true</c> if a element should be localized; otherwise, <c>false</c>.</value>
|
||||||
|
/// </summary>
|
||||||
|
[UsedImplicitly] public bool Required { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns whether the value of the given object is equal to the current <see cref="LocalizationRequiredAttribute"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj">The object to test the value equality of. </param>
|
||||||
|
/// <returns>
|
||||||
|
/// <c>true</c> if the value of the given object is equal to that of the current; otherwise, <c>false</c>.
|
||||||
|
/// </returns>
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
var attribute = obj as LocalizationRequiredAttribute;
|
||||||
|
return attribute != null && attribute.Required == Required;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the hash code for this instance.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A hash code for the current <see cref="LocalizationRequiredAttribute"/>.</returns>
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return base.GetHashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the marked method builds string by format pattern and (optional) arguments.
|
||||||
|
/// Parameter, which contains format string, should be given in constructor.
|
||||||
|
/// The format string should be in <see cref="string.Format(IFormatProvider,string,object[])"/> -like form
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// [StringFormatMethod("message")]
|
||||||
|
/// public void ShowError(string message, params object[] args)
|
||||||
|
/// {
|
||||||
|
/// //Do something
|
||||||
|
/// }
|
||||||
|
/// public void Foo()
|
||||||
|
/// {
|
||||||
|
/// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class StringFormatMethodAttribute : Attribute
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes new instance of StringFormatMethodAttribute
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="formatParameterName">Specifies which parameter of an annotated method should be treated as format-string</param>
|
||||||
|
public StringFormatMethodAttribute(string formatParameterName)
|
||||||
|
{
|
||||||
|
FormatParameterName = formatParameterName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets format parameter name
|
||||||
|
/// </summary>
|
||||||
|
[UsedImplicitly] public string FormatParameterName { get; private set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the function argument should be string literal and match one of the parameters
|
||||||
|
/// of the caller function.
|
||||||
|
/// For example, ReSharper annotates the parameter of <see cref="System.ArgumentNullException"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// public void Foo(string param)
|
||||||
|
/// {
|
||||||
|
/// if (param == null)
|
||||||
|
/// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class InvokerParameterNameAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the method is contained in a type that implements
|
||||||
|
/// <see cref="System.ComponentModel.INotifyPropertyChanged"/> interface
|
||||||
|
/// and this method is used to notify that some property value changed.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The method should be non-static and conform to one of the supported signatures:
|
||||||
|
/// <list>
|
||||||
|
/// <item><c>NotifyChanged(string)</c></item>
|
||||||
|
/// <item><c>NotifyChanged(params string[])</c></item>
|
||||||
|
/// <item><c>NotifyChanged{T}(Expression{Func{T}})</c></item>
|
||||||
|
/// <item><c>NotifyChanged{T,U}(Expression{Func{T,U}})</c></item>
|
||||||
|
/// <item><c>SetProperty{T}(ref T, T, string)</c></item>
|
||||||
|
/// </list>
|
||||||
|
/// </remarks>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// public class Foo : INotifyPropertyChanged
|
||||||
|
/// {
|
||||||
|
/// public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
///
|
||||||
|
/// [NotifyPropertyChangedInvocator]
|
||||||
|
/// protected virtual void NotifyChanged(string propertyName)
|
||||||
|
/// {}
|
||||||
|
///
|
||||||
|
/// private string _name;
|
||||||
|
/// public string Name
|
||||||
|
/// {
|
||||||
|
/// get { return _name; }
|
||||||
|
/// set
|
||||||
|
/// {
|
||||||
|
/// _name = value;
|
||||||
|
/// NotifyChanged("LastName"); // Warning
|
||||||
|
/// }
|
||||||
|
/// }
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// Examples of generated notifications:
|
||||||
|
/// <list>
|
||||||
|
/// <item><c>NotifyChanged("Property")</c></item>
|
||||||
|
/// <item><c>NotifyChanged(() => Property)</c></item>
|
||||||
|
/// <item><c>NotifyChanged((VM x) => x.Property)</c></item>
|
||||||
|
/// <item><c>SetProperty(ref myField, value, "Property")</c></item>
|
||||||
|
/// </list>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute
|
||||||
|
{
|
||||||
|
public NotifyPropertyChangedInvocatorAttribute() { }
|
||||||
|
public NotifyPropertyChangedInvocatorAttribute(string parameterName)
|
||||||
|
{
|
||||||
|
ParameterName = parameterName;
|
||||||
|
}
|
||||||
|
|
||||||
|
[UsedImplicitly] public string ParameterName { get; private set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the value of the marked element could be <c>null</c> sometimes,
|
||||||
|
/// so the check for <c>null</c> is necessary before its usage.
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// [CanBeNull]
|
||||||
|
/// public object Test()
|
||||||
|
/// {
|
||||||
|
/// return null;
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// public void UseTest()
|
||||||
|
/// {
|
||||||
|
/// var p = Test();
|
||||||
|
/// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class CanBeNullAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the value of the marked element could never be <c>null</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// [NotNull]
|
||||||
|
/// public object Foo()
|
||||||
|
/// {
|
||||||
|
/// return null; // Warning: Possible 'null' assignment
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Delegate | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class NotNullAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes dependency between method input and output.
|
||||||
|
/// </summary>
|
||||||
|
/// <syntax>
|
||||||
|
/// <p>Function Definition Table syntax:</p>
|
||||||
|
/// <list>
|
||||||
|
/// <item>FDT ::= FDTRow [;FDTRow]*</item>
|
||||||
|
/// <item>FDTRow ::= Input => Output | Output <= Input</item>
|
||||||
|
/// <item>Input ::= ParameterName: Value [, Input]*</item>
|
||||||
|
/// <item>Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}</item>
|
||||||
|
/// <item>Value ::= true | false | null | notnull | canbenull</item>
|
||||||
|
/// </list>
|
||||||
|
/// If method has single input parameter, it's name could be omitted. <br/>
|
||||||
|
/// Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same) for method output means that the methos doesn't return normally. <br/>
|
||||||
|
/// <c>canbenull</c> annotation is only applicable for output parameters. <br/>
|
||||||
|
/// You can use multiple <c>[ContractAnnotation]</c> for each FDT row, or use single attribute with rows separated by semicolon. <br/>
|
||||||
|
/// </syntax>
|
||||||
|
/// <examples>
|
||||||
|
/// <list>
|
||||||
|
/// <item><code>
|
||||||
|
/// [ContractAnnotation("=> halt")]
|
||||||
|
/// public void TerminationMethod()
|
||||||
|
/// </code></item>
|
||||||
|
/// <item><code>
|
||||||
|
/// [ContractAnnotation("halt <= condition: false")]
|
||||||
|
/// public void Assert(bool condition, string text) // Regular Assertion method
|
||||||
|
/// </code></item>
|
||||||
|
/// <item><code>
|
||||||
|
/// [ContractAnnotation("s:null => true")]
|
||||||
|
/// public bool IsNullOrEmpty(string s) // String.IsNullOrEmpty
|
||||||
|
/// </code></item>
|
||||||
|
/// <item><code>
|
||||||
|
/// // A method that returns null if the parameter is null, and not null if the parameter is not null
|
||||||
|
/// [ContractAnnotation("null => null; notnull => notnull")]
|
||||||
|
/// public object Transform(object data)
|
||||||
|
/// </code></item>
|
||||||
|
/// <item><code>
|
||||||
|
/// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
|
||||||
|
/// public bool TryParse(string s, out Person result)
|
||||||
|
/// </code></item>
|
||||||
|
/// </list>
|
||||||
|
/// </examples>
|
||||||
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
|
||||||
|
public sealed class ContractAnnotationAttribute : Attribute
|
||||||
|
{
|
||||||
|
public ContractAnnotationAttribute([NotNull] string fdt) : this (fdt, false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContractAnnotationAttribute([NotNull] string fdt, bool forceFullStates)
|
||||||
|
{
|
||||||
|
FDT = fdt;
|
||||||
|
ForceFullStates = forceFullStates;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string FDT { get; private set; }
|
||||||
|
public bool ForceFullStates { get; private set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the value of the marked type (or its derivatives)
|
||||||
|
/// cannot be compared using '==' or '!=' operators and <c>Equals()</c> should be used instead.
|
||||||
|
/// However, using '==' or '!=' for comparison with <c>null</c> is always permitted.
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// [CannotApplyEqualityOperator]
|
||||||
|
/// class NoEquality
|
||||||
|
/// {
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// class UsesNoEquality
|
||||||
|
/// {
|
||||||
|
/// public void Test()
|
||||||
|
/// {
|
||||||
|
/// var ca1 = new NoEquality();
|
||||||
|
/// var ca2 = new NoEquality();
|
||||||
|
///
|
||||||
|
/// if (ca1 != null) // OK
|
||||||
|
/// {
|
||||||
|
/// bool condition = ca1 == ca2; // Warning
|
||||||
|
/// }
|
||||||
|
/// }
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class CannotApplyEqualityOperatorAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// When applied to a target attribute, specifies a requirement for any type marked with
|
||||||
|
/// the target attribute to implement or inherit specific type or types.
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// [BaseTypeRequired(typeof(IComponent)] // Specify requirement
|
||||||
|
/// public class ComponentAttribute : Attribute
|
||||||
|
/// {}
|
||||||
|
///
|
||||||
|
/// [Component] // ComponentAttribute requires implementing IComponent interface
|
||||||
|
/// public class MyComponent : IComponent
|
||||||
|
/// {}
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||||
|
[BaseTypeRequired(typeof(Attribute))]
|
||||||
|
public sealed class BaseTypeRequiredAttribute : Attribute
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes new instance of BaseTypeRequiredAttribute
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="baseType">Specifies which types are required</param>
|
||||||
|
public BaseTypeRequiredAttribute(Type baseType)
|
||||||
|
{
|
||||||
|
BaseTypes = new[] { baseType };
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets enumerations of specified base types
|
||||||
|
/// </summary>
|
||||||
|
public Type[] BaseTypes { get; private set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library),
|
||||||
|
/// so this symbol will not be marked as unused (as well as by other usage inspections)
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class UsedImplicitlyAttribute : Attribute
|
||||||
|
{
|
||||||
|
[UsedImplicitly] public UsedImplicitlyAttribute()
|
||||||
|
: this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
|
||||||
|
{
|
||||||
|
UseKindFlags = useKindFlags;
|
||||||
|
TargetFlags = targetFlags;
|
||||||
|
}
|
||||||
|
|
||||||
|
[UsedImplicitly] public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags)
|
||||||
|
: this(useKindFlags, ImplicitUseTargetFlags.Default) { }
|
||||||
|
|
||||||
|
[UsedImplicitly] public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags)
|
||||||
|
: this(ImplicitUseKindFlags.Default, targetFlags) { }
|
||||||
|
|
||||||
|
[UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets value indicating what is meant to be used
|
||||||
|
/// </summary>
|
||||||
|
[UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Should be used on attributes and causes ReSharper
|
||||||
|
/// to not mark symbols marked with such attributes as unused (as well as by other usage inspections)
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
|
||||||
|
public sealed class MeansImplicitUseAttribute : Attribute
|
||||||
|
{
|
||||||
|
[UsedImplicitly] public MeansImplicitUseAttribute()
|
||||||
|
: this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)
|
||||||
|
{
|
||||||
|
UseKindFlags = useKindFlags;
|
||||||
|
TargetFlags = targetFlags;
|
||||||
|
}
|
||||||
|
|
||||||
|
[UsedImplicitly] public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags)
|
||||||
|
: this(useKindFlags, ImplicitUseTargetFlags.Default)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[UsedImplicitly] public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags)
|
||||||
|
: this(ImplicitUseKindFlags.Default, targetFlags) { }
|
||||||
|
|
||||||
|
[UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets value indicating what is meant to be used
|
||||||
|
/// </summary>
|
||||||
|
[UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum ImplicitUseKindFlags
|
||||||
|
{
|
||||||
|
Default = Access | Assign | InstantiatedWithFixedConstructorSignature,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Only entity marked with attribute considered used
|
||||||
|
/// </summary>
|
||||||
|
Access = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates implicit assignment to a member
|
||||||
|
/// </summary>
|
||||||
|
Assign = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates implicit instantiation of a type with fixed constructor signature.
|
||||||
|
/// That means any unused constructor parameters won't be reported as such.
|
||||||
|
/// </summary>
|
||||||
|
InstantiatedWithFixedConstructorSignature = 4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates implicit instantiation of a type
|
||||||
|
/// </summary>
|
||||||
|
InstantiatedNoFixedConstructorSignature = 8,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Specify what is considered used implicitly when marked with <see cref="MeansImplicitUseAttribute"/> or <see cref="UsedImplicitlyAttribute"/>
|
||||||
|
/// </summary>
|
||||||
|
[Flags]
|
||||||
|
public enum ImplicitUseTargetFlags
|
||||||
|
{
|
||||||
|
Default = Itself,
|
||||||
|
|
||||||
|
Itself = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Members of entity marked with attribute are considered used
|
||||||
|
/// </summary>
|
||||||
|
Members = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Entity marked with attribute and all its members considered used
|
||||||
|
/// </summary>
|
||||||
|
WithMembers = Itself | Members
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This attribute is intended to mark publicly available API which should not be removed and so is treated as used.
|
||||||
|
/// </summary>
|
||||||
|
[MeansImplicitUse]
|
||||||
|
public sealed class PublicAPIAttribute : Attribute
|
||||||
|
{
|
||||||
|
public PublicAPIAttribute() { }
|
||||||
|
public PublicAPIAttribute(string comment) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack.
|
||||||
|
/// If the parameter is a delegate, indicates that delegate is executed while the method is executed.
|
||||||
|
/// If the parameter is an enumerable, indicates that it is enumerated while the method is executed.
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter, Inherited = true)]
|
||||||
|
public sealed class InstantHandleAttribute : Attribute { }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that a method does not make any observable state changes.
|
||||||
|
/// The same as <see cref="System.Diagnostics.Contracts.PureAttribute"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// [Pure]
|
||||||
|
/// private int Multiply(int x, int y)
|
||||||
|
/// {
|
||||||
|
/// return x*y;
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// public void Foo()
|
||||||
|
/// {
|
||||||
|
/// const int a=2, b=2;
|
||||||
|
/// Multiply(a, b); // Waring: Return value of pure method is not used
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Method, Inherited = true)]
|
||||||
|
public sealed class PureAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that a parameter is a path to a file or a folder within a web project.
|
||||||
|
/// Path can be relative or absolute, starting from web root (~).
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter)]
|
||||||
|
public class PathReferenceAttribute : Attribute
|
||||||
|
{
|
||||||
|
public PathReferenceAttribute() { }
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
public PathReferenceAttribute([PathReference] string basePath)
|
||||||
|
{
|
||||||
|
BasePath = basePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
[UsedImplicitly] public string BasePath { get; private set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// ASP.NET MVC attributes
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC action.
|
||||||
|
/// If applied to a method, the MVC action name is calculated implicitly from the context.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||||
|
public sealed class AspMvcActionAttribute : Attribute
|
||||||
|
{
|
||||||
|
[UsedImplicitly] public string AnonymousProperty { get; private set; }
|
||||||
|
|
||||||
|
public AspMvcActionAttribute() { }
|
||||||
|
|
||||||
|
public AspMvcActionAttribute(string anonymousProperty)
|
||||||
|
{
|
||||||
|
AnonymousProperty = anonymousProperty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC araa.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter)]
|
||||||
|
public sealed class AspMvcAreaAttribute : PathReferenceAttribute
|
||||||
|
{
|
||||||
|
[UsedImplicitly] public string AnonymousProperty { get; private set; }
|
||||||
|
|
||||||
|
[UsedImplicitly] public AspMvcAreaAttribute() { }
|
||||||
|
|
||||||
|
public AspMvcAreaAttribute(string anonymousProperty)
|
||||||
|
{
|
||||||
|
AnonymousProperty = anonymousProperty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC controller.
|
||||||
|
/// If applied to a method, the MVC controller name is calculated implicitly from the context.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||||
|
public sealed class AspMvcControllerAttribute : Attribute
|
||||||
|
{
|
||||||
|
[UsedImplicitly] public string AnonymousProperty { get; private set; }
|
||||||
|
|
||||||
|
public AspMvcControllerAttribute() { }
|
||||||
|
|
||||||
|
public AspMvcControllerAttribute(string anonymousProperty)
|
||||||
|
{
|
||||||
|
AnonymousProperty = anonymousProperty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Controller.View(String, String)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter)]
|
||||||
|
public sealed class AspMvcMasterAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Controller.View(String, Object)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter)]
|
||||||
|
public sealed class AspMvcModelTypeAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC partial view.
|
||||||
|
/// If applied to a method, the MVC partial view name is calculated implicitly from the context.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||||
|
public sealed class AspMvcPartialViewAttribute : PathReferenceAttribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. Allows disabling all inspections for MVC views within a class or a method.
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
|
||||||
|
public sealed class AspMvcSupressViewErrorAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter)]
|
||||||
|
public sealed class AspMvcDisplayTemplateAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter)]
|
||||||
|
public sealed class AspMvcEditorTemplateAttribute : Attribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC view.
|
||||||
|
/// If applied to a method, the MVC view name is calculated implicitly from the context.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.Mvc.Controller.View(Object)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]
|
||||||
|
public sealed class AspMvcViewAttribute : PathReferenceAttribute { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASP.NET MVC attribute. When applied to a parameter of an attribute,
|
||||||
|
/// indicates that this parameter is an MVC action name.
|
||||||
|
/// </summary>
|
||||||
|
/// <example>
|
||||||
|
/// <code>
|
||||||
|
/// [ActionName("Foo")]
|
||||||
|
/// public ActionResult Login(string returnUrl)
|
||||||
|
/// {
|
||||||
|
/// ViewBag.ReturnUrl = Url.Action("Foo"); // OK
|
||||||
|
/// return RedirectToAction("Bar"); // Error: Cannot resolve action
|
||||||
|
/// }
|
||||||
|
/// </code>
|
||||||
|
/// </example>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
|
||||||
|
public sealed class AspMvcActionSelectorAttribute : Attribute { }
|
||||||
|
|
||||||
|
// Razor attributes
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Razor attribute. Indicates that a parameter or a method is a Razor section.
|
||||||
|
/// Use this attribute for custom wrappers similar to
|
||||||
|
/// <see cref="System.Web.WebPages.WebPageBase.RenderSection(String)"/>
|
||||||
|
/// </summary>
|
||||||
|
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, Inherited = true)]
|
||||||
|
public sealed class RazorSectionAttribute : Attribute { }
|
||||||
|
|
||||||
|
}
|
55
Application/FileConverter/Properties/AssemblyInfo.cs
Normal file
55
Application/FileConverter/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Resources;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("FileConverter")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("FileConverter")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// In order to begin building localizable applications, set
|
||||||
|
// <UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||||
|
// inside a <PropertyGroup>. For example, if you are using US english
|
||||||
|
// in your source files, set the <UICulture> to en-US. Then uncomment
|
||||||
|
// the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||||
|
// the line below to match the UICulture setting in the project file.
|
||||||
|
|
||||||
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
|
|
||||||
|
[assembly: ThemeInfo(
|
||||||
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// or application resource dictionaries)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// app, or any theme specific resource dictionaries)
|
||||||
|
)]
|
||||||
|
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
71
Application/FileConverter/Properties/Resources.Designer.cs
generated
Normal file
71
Application/FileConverter/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.18444
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace FileConverter.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((resourceMan == null))
|
||||||
|
{
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileConverter.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
117
Application/FileConverter/Properties/Resources.resx
Normal file
117
Application/FileConverter/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
30
Application/FileConverter/Properties/Settings.Designer.cs
generated
Normal file
30
Application/FileConverter/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.18444
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace FileConverter.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
7
Application/FileConverter/Properties/Settings.settings
Normal file
7
Application/FileConverter/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
5
Application/FileConverter/ReadMe.txt
Normal file
5
Application/FileConverter/ReadMe.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
-------------------------------------------------------------------------------
|
||||||
|
File Converter v 0.x
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
This program use ffmpeg.
|
24
Application/FileConverter/Settings.StyleCop
Normal file
24
Application/FileConverter/Settings.StyleCop
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<StyleCopSettings Version="105">
|
||||||
|
<Analyzers>
|
||||||
|
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
|
||||||
|
<Rules>
|
||||||
|
<Rule Name="ElementsMustBeDocumented">
|
||||||
|
<RuleSettings>
|
||||||
|
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||||
|
</RuleSettings>
|
||||||
|
</Rule>
|
||||||
|
<Rule Name="EnumerationItemsMustBeDocumented">
|
||||||
|
<RuleSettings>
|
||||||
|
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||||
|
</RuleSettings>
|
||||||
|
</Rule>
|
||||||
|
<Rule Name="PartialElementsMustBeDocumented">
|
||||||
|
<RuleSettings>
|
||||||
|
<BooleanProperty Name="Enabled">False</BooleanProperty>
|
||||||
|
</RuleSettings>
|
||||||
|
</Rule>
|
||||||
|
</Rules>
|
||||||
|
<AnalyzerSettings />
|
||||||
|
</Analyzer>
|
||||||
|
</Analyzers>
|
||||||
|
</StyleCopSettings>
|
140
Application/FileConverterExtension/FileConverterExtension.cs
Normal file
140
Application/FileConverterExtension/FileConverterExtension.cs
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
// <copyright file="FileConverterExtension.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||||
|
|
||||||
|
namespace FileConverterExtension
|
||||||
|
{
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
|
using SharpShell.Attributes;
|
||||||
|
using SharpShell.SharpContextMenu;
|
||||||
|
|
||||||
|
[ComVisible(true), Guid("AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90")]
|
||||||
|
[COMServerAssociation(AssociationType.AllFiles)]
|
||||||
|
public class FileConverterExtension : SharpContextMenu
|
||||||
|
{
|
||||||
|
private string fileConverterPath;
|
||||||
|
|
||||||
|
protected override bool CanShowMenu()
|
||||||
|
{
|
||||||
|
foreach (string filePath in this.SelectedItemPaths)
|
||||||
|
{
|
||||||
|
string extension = Path.GetExtension(filePath);
|
||||||
|
if (string.IsNullOrEmpty(extension))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
extension = extension.Substring(1).ToLowerInvariant();
|
||||||
|
switch (extension)
|
||||||
|
{
|
||||||
|
case "mp3":
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case "wav":
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case "ogg":
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case "flac":
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override ContextMenuStrip CreateMenu()
|
||||||
|
{
|
||||||
|
ContextMenuStrip menu = new ContextMenuStrip();
|
||||||
|
|
||||||
|
ToolStripMenuItem fileConverterItem = new ToolStripMenuItem
|
||||||
|
{
|
||||||
|
Text = "File Converter"
|
||||||
|
};
|
||||||
|
|
||||||
|
{
|
||||||
|
ToolStripMenuItem subItem = new ToolStripMenuItem
|
||||||
|
{
|
||||||
|
Text = "To Ogg",
|
||||||
|
};
|
||||||
|
|
||||||
|
fileConverterItem.DropDownItems.Add(subItem);
|
||||||
|
subItem.Click += (sender, args) => this.ConvertFiles(FileType.Ogg);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ToolStripMenuItem subItem = new ToolStripMenuItem
|
||||||
|
{
|
||||||
|
Text = "To Mp3",
|
||||||
|
};
|
||||||
|
|
||||||
|
fileConverterItem.DropDownItems.Add(subItem);
|
||||||
|
subItem.Click += (sender, args) => this.ConvertFiles(FileType.Mp3);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ToolStripMenuItem subItem = new ToolStripMenuItem
|
||||||
|
{
|
||||||
|
Text = "To Flac",
|
||||||
|
};
|
||||||
|
|
||||||
|
fileConverterItem.DropDownItems.Add(subItem);
|
||||||
|
subItem.Click += (sender, args) => this.ConvertFiles(FileType.Flac);
|
||||||
|
}
|
||||||
|
|
||||||
|
menu.Items.Add(fileConverterItem);
|
||||||
|
|
||||||
|
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software\FileConverter");
|
||||||
|
this.fileConverterPath = null;
|
||||||
|
if (registryKey != null)
|
||||||
|
{
|
||||||
|
this.fileConverterPath = registryKey.GetValue("Path") as string;
|
||||||
|
}
|
||||||
|
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ConvertFiles(FileType ouputType)
|
||||||
|
{
|
||||||
|
this.fileConverterPath = @"D:\Projects\FileConverter\FileConverter\Application\FileConverter\bin\Debug\FileConverter.exe";
|
||||||
|
if (string.IsNullOrEmpty(this.fileConverterPath))
|
||||||
|
{
|
||||||
|
MessageBox.Show(string.Format("Can't retrieve the file converter executable path. You should try to reinstall the application."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!File.Exists(this.fileConverterPath))
|
||||||
|
{
|
||||||
|
MessageBox.Show(string.Format("Can't find the file converter executable ({0}). You should try to reinstall the application.", this.fileConverterPath));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessStartInfo processStartInfo = new ProcessStartInfo(this.fileConverterPath);
|
||||||
|
|
||||||
|
processStartInfo.CreateNoWindow = false;
|
||||||
|
processStartInfo.UseShellExecute = false;
|
||||||
|
processStartInfo.RedirectStandardOutput = false;
|
||||||
|
|
||||||
|
// Build arguments string.
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
stringBuilder.Append("--output-type ");
|
||||||
|
stringBuilder.Append(ouputType.ToString());
|
||||||
|
|
||||||
|
foreach (var filePath in this.SelectedItemPaths)
|
||||||
|
{
|
||||||
|
stringBuilder.Append(" \"");
|
||||||
|
stringBuilder.Append(filePath);
|
||||||
|
stringBuilder.Append("\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
processStartInfo.Arguments = stringBuilder.ToString();
|
||||||
|
Process exeProcess = Process.Start(processStartInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{0C44CA69-42D6-4357-BDFD-83069D1ABA2F}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>FileConverterExtension</RootNamespace>
|
||||||
|
<AssemblyName>FileConverterExtension</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>FileConverterExtensionKey.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="SharpShell">
|
||||||
|
<HintPath>..\..\Middleware\SharpShell\SharpShell.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="FileConverterExtension.cs" />
|
||||||
|
<Compile Include="FileType.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="FileConverterExtensionKey.snk" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
BIN
Application/FileConverterExtension/FileConverterExtensionKey.snk
Normal file
BIN
Application/FileConverterExtension/FileConverterExtensionKey.snk
Normal file
Binary file not shown.
13
Application/FileConverterExtension/FileType.cs
Normal file
13
Application/FileConverterExtension/FileType.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// <copyright file="FileType.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
||||||
|
|
||||||
|
namespace FileConverterExtension
|
||||||
|
{
|
||||||
|
public enum FileType
|
||||||
|
{
|
||||||
|
Undefined,
|
||||||
|
|
||||||
|
Mp3,
|
||||||
|
Ogg,
|
||||||
|
Flac,
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("FileConverterExtension")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("FileConverterExtension")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("86f3928d-94ef-4d27-8235-1074894e9b5f")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
23
Installer/Extension.wxs
Normal file
23
Installer/Extension.wxs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||||
|
<Fragment>
|
||||||
|
<DirectoryRef Id="INSTALLFOLDER">
|
||||||
|
<Component Id="FileConverterExtension.dll" Guid="{B92C004D-58F5-46E1-80C3-8BB19C494924}">
|
||||||
|
<Class Id="{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}" Context="InprocServer32" Description="FileConverterExtension.FileConverterExtension" ThreadingModel="both" ForeignServer="mscoree.dll">
|
||||||
|
<ProgId Id="FileConverterExtension.FileConverterExtension" Description="FileConverterExtension.FileConverterExtension" />
|
||||||
|
</Class>
|
||||||
|
<File Id="FileConverterExtension.dll" KeyPath="yes" Source="..\Application\FileConverterExtension\bin\Debug\FileConverterExtension.dll" />
|
||||||
|
<RegistryValue Root="HKLM" Key="*\shellex\ContextMenuHandlers\FileConverterExtension" Value="{af9b72b5-f4e4-44b0-a3d9-b55b748efe90}" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="Class" Value="FileConverterExtension.FileConverterExtension" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="Assembly" Value="FileConverterExtension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15400b1c4b948c8a" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#FileConverterExtension.dll]" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="Class" Value="FileConverterExtension.FileConverterExtension" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="Assembly" Value="FileConverterExtension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15400b1c4b948c8a" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
|
||||||
|
<RegistryValue Root="HKLM" Key="CLSID\{AF9B72B5-F4E4-44B0-A3D9-B55B748EFE90}\InprocServer32" Name="CodeBase" Value="file:///[#FileConverterExtension.dll]" Type="string" Action="write" />
|
||||||
|
</Component>
|
||||||
|
</DirectoryRef>
|
||||||
|
</Fragment>
|
||||||
|
</Wix>
|
1
Installer/GenerateExtensionWxsFile.bat
Normal file
1
Installer/GenerateExtensionWxsFile.bat
Normal file
@ -0,0 +1 @@
|
|||||||
|
"C:\Program Files (x86)\Wix Toolset v3.9\bin\Heat.exe" file "..\Application\FileConverterExtension\bin\Debug\FileConverterExtension.dll" -dr INSTALLFOLDER -srd -gg -sfrag -suid -out "Extension.wxs" -b "..\Application\FileConverterExtension\bin\Debug\"
|
52
Installer/Installer.wixproj
Normal file
52
Installer/Installer.wixproj
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||||
|
<ProductVersion>3.9</ProductVersion>
|
||||||
|
<ProjectGuid>f14673df-df38-44b4-ab1d-99a59182c24c</ProjectGuid>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<OutputName>Installer</OutputName>
|
||||||
|
<OutputType>Package</OutputType>
|
||||||
|
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||||
|
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
|
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||||
|
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||||
|
<DefineConstants>Debug</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
|
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||||
|
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Extension.wxs" />
|
||||||
|
<Compile Include="Product.wxs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<WixExtension Include="WixUIExtension">
|
||||||
|
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
|
||||||
|
<Name>WixUIExtension</Name>
|
||||||
|
</WixExtension>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Application\FileConverter\FileConverter.csproj">
|
||||||
|
<Name>FileConverter</Name>
|
||||||
|
<Project>{d27a76d2-43e4-43cc-9da3-334b0b46f4e5}</Project>
|
||||||
|
<Private>True</Private>
|
||||||
|
<DoNotHarvest>True</DoNotHarvest>
|
||||||
|
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
|
||||||
|
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(WixTargetsPath)" />
|
||||||
|
<!--
|
||||||
|
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Wix.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
56
Installer/Product.wxs
Normal file
56
Installer/Product.wxs
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||||
|
<Product Id="*" Name="File Converter" Language="1033" Version="0.1.0" Manufacturer="AAllard" UpgradeCode="e3ca717b-a897-418a-bbef-5c7e35c76e4b">
|
||||||
|
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
|
||||||
|
|
||||||
|
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
|
||||||
|
<MediaTemplate />
|
||||||
|
|
||||||
|
<Feature Id="ProductFeature" Title="Installer" Level="1">
|
||||||
|
<ComponentGroupRef Id="ProductComponents" />
|
||||||
|
</Feature>
|
||||||
|
|
||||||
|
<Feature Id="ShellExtensionFeature" Title="ShellExtension" Level="1">
|
||||||
|
<ComponentRef Id="FileConverterExtension.dll"/>
|
||||||
|
</Feature>
|
||||||
|
|
||||||
|
<UIRef Id="WixUI_InstallDir" />
|
||||||
|
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||||
|
</Product>
|
||||||
|
|
||||||
|
<Fragment>
|
||||||
|
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||||
|
<Directory Id="ProgramFilesFolder">
|
||||||
|
<Directory Id="INSTALLFOLDER" Name="File Converter" />
|
||||||
|
</Directory>
|
||||||
|
</Directory>
|
||||||
|
</Fragment>
|
||||||
|
|
||||||
|
<Fragment>
|
||||||
|
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
|
||||||
|
<!-- Resources -->
|
||||||
|
<Component Guid="{9BF0AC45-A586-41C9-BA93-6048B46DA65F}">
|
||||||
|
<File Id="SharpShell.dll" KeyPath="yes" Source="..\Middleware\SharpShell\SharpShell.dll" />
|
||||||
|
</Component>
|
||||||
|
<Component Guid="{AA5EA6F7-C443-488B-8E48-7CF000B9AD2A}">
|
||||||
|
<File Source="$(var.FileConverter.TargetPath)" KeyPath="yes" />
|
||||||
|
</Component>
|
||||||
|
<Component Guid="{97A5208C-5135-43BD-88EF-151D0673D5D2}">
|
||||||
|
<File Source="..\Application\FileConverter\bin\Debug\FileConverter.exe.config" KeyPath="yes" />
|
||||||
|
</Component>
|
||||||
|
<Component Guid="{1790B82E-86BC-4B95-AA1D-9859FF3B6CA4}">
|
||||||
|
<File Source="..\Middleware\ffmpeg.exe" KeyPath="yes" />
|
||||||
|
</Component>
|
||||||
|
<Component Guid="{A5158756-A107-4010-9E2F-3C0333F5A5F6}">
|
||||||
|
<File Source="..\Application\FileConverter\readme.txt" KeyPath="yes" />
|
||||||
|
</Component>
|
||||||
|
|
||||||
|
<!-- Registry entries -->
|
||||||
|
<Component Id="RegistryEntries" Guid="{C3EF3D67-0206-4DBD-B2EA-78FF2E290093}">
|
||||||
|
<RegistryKey Root="HKCU" Key="Software\FileConverter" Action="createAndRemoveOnUninstall">
|
||||||
|
<RegistryValue Name="Path" Type="string" Value="[INSTALLFOLDER]FileConverter.exe"/>
|
||||||
|
</RegistryKey>
|
||||||
|
</Component>
|
||||||
|
</ComponentGroup>
|
||||||
|
</Fragment>
|
||||||
|
</Wix>
|
BIN
Middleware/SharpShell/ServerManager/Apex.WinForms.dll
Normal file
BIN
Middleware/SharpShell/ServerManager/Apex.WinForms.dll
Normal file
Binary file not shown.
BIN
Middleware/SharpShell/ServerManager/ServerManager.exe
Normal file
BIN
Middleware/SharpShell/ServerManager/ServerManager.exe
Normal file
Binary file not shown.
BIN
Middleware/SharpShell/ServerManager/SharpShell.dll
Normal file
BIN
Middleware/SharpShell/ServerManager/SharpShell.dll
Normal file
Binary file not shown.
BIN
Middleware/SharpShell/ServerManager/SharpShell.zip
Normal file
BIN
Middleware/SharpShell/ServerManager/SharpShell.zip
Normal file
Binary file not shown.
BIN
Middleware/SharpShell/ServerManager/srm.zip
Normal file
BIN
Middleware/SharpShell/ServerManager/srm.zip
Normal file
Binary file not shown.
BIN
Middleware/SharpShell/SharpShell.dll
Normal file
BIN
Middleware/SharpShell/SharpShell.dll
Normal file
Binary file not shown.
10224
Middleware/SharpShell/SharpShell.xml
Normal file
10224
Middleware/SharpShell/SharpShell.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Middleware/ffmpeg.exe
Normal file
BIN
Middleware/ffmpeg.exe
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user