Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
dch committed Apr 28, 2019
1 parent ab18b92 commit abd0f46
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 34 deletions.
3 changes: 3 additions & 0 deletions dff2dsf/FileToProcess.cs
Expand Up @@ -13,6 +13,7 @@ public class FileToProcess : INotifyPropertyChanged
private string _destFile;
private string _status;

[DisplayName("Source File")]
public string SrcFile
{
get => _srcFile;
Expand All @@ -23,6 +24,7 @@ public string SrcFile
}
}

[DisplayName("Preview File")]
public string DestFile
{
get => _destFile;
Expand All @@ -33,6 +35,7 @@ public string DestFile
}
}

[DisplayName("Result")]
public string Status
{
get => _status;
Expand Down
105 changes: 90 additions & 15 deletions dff2dsf/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 15 additions & 9 deletions dff2dsf/Form1.cs
Expand Up @@ -14,7 +14,7 @@ namespace dff2dsf
{
public partial class Form1 : Form
{
private BindingList<FileToProcess> bindingList = new BindingList<FileToProcess>();
private readonly BindingList<FileToProcess> bindingList = new BindingList<FileToProcess>();

public Form1()
{
Expand All @@ -28,7 +28,7 @@ private void button2_Click(object sender, EventArgs e)
{
using (var fbd = new FolderBrowserDialog())
{
DialogResult result = fbd.ShowDialog();
var result = fbd.ShowDialog();

if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
{
Expand Down Expand Up @@ -70,13 +70,15 @@ private void button1_Click(object sender, EventArgs e)

using (var process = new Process())
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = Path.GetFullPath(converter);
startInfo.UseShellExecute = false;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.CreateNoWindow = true;
startInfo.Arguments = $"{tempSrcFile} {tempTargetFile}";
var startInfo = new ProcessStartInfo
{
FileName = Path.GetFullPath(converter),
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true,
CreateNoWindow = true,
Arguments = $"{tempSrcFile} {tempTargetFile}"
};

process.StartInfo = startInfo;
process.Start();
Expand Down Expand Up @@ -104,7 +106,11 @@ private void button1_Click(object sender, EventArgs e)
file.Status = ex.Message;
}
}
}

private void toolStripStatusLabel1_Click(object sender, EventArgs e)
{
Process.Start("http://www.microsoft.com/en-us/download/details.aspx?id=26999");
}
}
}
3 changes: 3 additions & 0 deletions dff2dsf/Form1.resx
Expand Up @@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
32 changes: 24 additions & 8 deletions dff2dsf/Program.cs
@@ -1,22 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace dff2dsf
{
static class Program
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
try
{
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

Application.ThreadException += (s, e) => { MessageBox.Show(e.Exception.Message); };

AppDomain.CurrentDomain.UnhandledException += (s, e) =>
{
if (e.ExceptionObject is Exception ex)
{
MessageBox.Show(ex.Message);
}
};

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
}
}
68 changes: 68 additions & 0 deletions dff2dsf/app.manifest
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>

0 comments on commit abd0f46

Please sign in to comment.