Created a properties form, testing dynamic UI building for the relevant MKV attributes.

This commit is contained in:
2017-09-07 14:25:33 -05:00
parent ae5a8284b6
commit 51ab989cb8
8 changed files with 531 additions and 43 deletions
+44
View File
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MKVTest
{
class MkvWriter
{
public bool WriteMkvMetaData(string commandString)
{
var process = new Process();
var startInfo = new ProcessStartInfo
{
WindowStyle = ProcessWindowStyle.Normal,
FileName = "cmd.exe",
Arguments = commandString
};
if (!CheckFiles())
{
throw new FileNotFoundException("Required files, mkvpropedit.exe and mkvinfo.exe not found.");
}
process.StartInfo = startInfo;
process.Start();
while (!process.HasExited)
{
}
if (process.ExitCode == 0) return true;
var error = File.ReadAllLines("temp.txt");
throw new ApplicationException(error.ToString());
}
public static bool CheckFiles()
{
return File.Exists("mkvpropedit.exe") && File.Exists("mkvinfo.exe");
}
}
}