-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd61d35
commit 72ed928
Showing
29 changed files
with
1,133 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.25420.1 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sunxi-fex-tools-gui4win", "sunxi-fex-tools-gui4win\sunxi-fex-tools-gui4win.csproj", "{B56E3DD3-F4B4-4916-ADDE-5F2237CA44E7}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B56E3DD3-F4B4-4916-ADDE-5F2237CA44E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B56E3DD3-F4B4-4916-ADDE-5F2237CA44E7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B56E3DD3-F4B4-4916-ADDE-5F2237CA44E7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B56E3DD3-F4B4-4916-ADDE-5F2237CA44E7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | ||
</startup> | ||
</configuration> |
217 changes: 217 additions & 0 deletions
217
sunxi-fex-tools-gui4win/sunxi-fex-tools-gui4win/Form1.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
143 changes: 143 additions & 0 deletions
143
sunxi-fex-tools-gui4win/sunxi-fex-tools-gui4win/Form1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
using System.Diagnostics;//ADD | ||
using System.IO; | ||
|
||
|
||
namespace sunxi_fex_tools_gui4win | ||
{ | ||
public partial class MainForm1 : Form | ||
{ | ||
String Fexc = "bin\\sunxi-fexc.exe"; | ||
String Bin2fex = "-I bin -O fex "; | ||
String Fex2bin = "-I fex -O bin "; | ||
String Fex2binCmd; | ||
String Bin2fexCmd; | ||
|
||
public MainForm1() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void button2_Click(object sender, EventArgs e) | ||
{ | ||
Bin2fexCmd = Bin2fex + PathBin.Text + " " + Path.GetDirectoryName(PathBin.Text) + "\\" + Path.GetFileNameWithoutExtension(PathBin.Text) + ".fex"; | ||
try | ||
{ | ||
Process proc = Process.Start(Fexc, Bin2fexCmd); | ||
if (proc != null) | ||
{ | ||
proc.WaitForExit(); | ||
MessageBox.Show(String.Format("bin2fex转换成功!", this.Fexc), this.Text, | ||
MessageBoxButtons.OK, MessageBoxIcon.Information); | ||
} | ||
} | ||
catch (ArgumentException ex) | ||
{ | ||
MessageBox.Show(ex.Message, this.Text, | ||
MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
} | ||
|
||
private void button6_Click(object sender, EventArgs e) | ||
{ | ||
Fex2binCmd = Fex2bin + PathFex.Text + " " + Path.GetDirectoryName(PathFex.Text) + "\\" + Path.GetFileNameWithoutExtension(PathFex.Text) + ".bin"; | ||
try | ||
{ | ||
Process proc = Process.Start(Fexc, Fex2binCmd); | ||
if (proc != null) | ||
{ | ||
proc.WaitForExit(); | ||
MessageBox.Show(String.Format("fex2bin转换成功!", this.Fexc), this.Text, | ||
MessageBoxButtons.OK, MessageBoxIcon.Information); | ||
} | ||
} | ||
catch (ArgumentException ex) | ||
{ | ||
MessageBox.Show(ex.Message, this.Text, | ||
MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
} | ||
|
||
private void button4_Click(object sender, EventArgs e) | ||
{ | ||
if (openBinDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) | ||
{ | ||
System.IO.StreamReader sr = new | ||
System.IO.StreamReader(openBinDialog.FileName); | ||
sr.Close(); | ||
PathBin.Text = openBinDialog.FileName; | ||
} | ||
} | ||
|
||
private void button5_Click(object sender, EventArgs e) | ||
{ | ||
if (openFexDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) | ||
{ | ||
System.IO.StreamReader sr = new | ||
System.IO.StreamReader(openFexDialog.FileName); | ||
sr.Close(); | ||
PathFex.Text = openFexDialog.FileName; | ||
} | ||
} | ||
|
||
|
||
private void button1_Click(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void About_Click(object sender, EventArgs e) | ||
{ | ||
MessageBox.Show("关于 Allwinner 配置档转换工具\n\n版本 v1.0 beta\n\nLicense:\nGPLv2\n\nOpen Source Components:\nsunxi-tools (https://github.com/linux-sunxi/sunxi-tools)\nCygwin (https://www.cygwin.com/)\n"); | ||
} | ||
|
||
private void PathFex_DragEnter(object sender, DragEventArgs e) | ||
{ | ||
if (e.Data.GetDataPresent(DataFormats.FileDrop)) | ||
{ | ||
e.Effect = DragDropEffects.Link; | ||
} | ||
else | ||
{ | ||
e.Effect = DragDropEffects.None; | ||
} | ||
} | ||
|
||
private void PathFex_DragDrop(object sender, DragEventArgs e) | ||
{ | ||
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); | ||
this.PathFex.Text = path; | ||
} | ||
|
||
private void PathBin_DragEnter(object sender, DragEventArgs e) | ||
{ | ||
if (e.Data.GetDataPresent(DataFormats.FileDrop)) | ||
{ | ||
e.Effect = DragDropEffects.Link; | ||
} | ||
else | ||
{ | ||
e.Effect = DragDropEffects.None; | ||
} | ||
} | ||
|
||
private void PathBin_DragDrop(object sender, DragEventArgs e) | ||
{ | ||
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); | ||
this.PathBin.Text = path; | ||
} | ||
|
||
private void Exit_Click(object sender, EventArgs e) | ||
{ | ||
Application.Exit(); | ||
} | ||
} | ||
} |
Oops, something went wrong.