FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[AppMan][Haxe] Added 'HashLink' into config.xml. fixes #3151 (#3153) · fdorg/flashdevelop@2ae4842 · GitHub

Repository navigation

Commit 2ae4842

Browse files
SlavaRa
authored
[AppMan][Haxe] Added 'HashLink' into config.xml. fixes #3151 (#3153)
1 parent bd195f5 commit 2ae4842

14 files changed

Lines changed: 722 additions & 753 deletions

File tree

‎External/Tools/AppMan/AppMan.csproj‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@
5555
</PropertyGroup>
5656
<ItemGroup>
5757
<Reference Include="System" />
58-
<Reference Include="System.Data" />
59-
<Reference Include="System.Deployment" />
6058
<Reference Include="System.Drawing" />
6159
<Reference Include="System.Windows.Forms" />
6260
<Reference Include="System.Xml" />

‎External/Tools/AppMan/MainForm.cs‎

Lines changed: 626 additions & 630 deletions
Large diffs are not rendered by default.

‎External/Tools/AppMan/Program.cs‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Runtime.InteropServices;
42
using System.Windows.Forms;
53
using System.Threading;
64

75
namespace AppMan
86
{
9-
static class Program
7+
internal static class Program
108
{
119
/// <summary>
1210
/// SIA Mutex entry
1311
/// </summary>
14-
private static Mutex mutex = new Mutex(true, "{2A46BA9B-F8DA-40AA-904F-4C1630BA4428}");
12+
static readonly Mutex mutex = new Mutex(true, "{2A46BA9B-F8DA-40AA-904F-4C1630BA4428}");
1513

1614
/// <summary>
1715
/// The main entry point for the application.
1816
/// </summary>
1917
[STAThread]
20-
static void Main(String[] args)
18+
static void Main(string[] args)
2119
{
2220
try
2321
{
@@ -39,7 +37,5 @@ static void Main(String[] args)
3937
MessageBox.Show("Error while starting AppMan:\n" + ex.ToString());
4038
}
4139
}
42-
4340
}
44-
45-
}
41+
}

‎External/Tools/AppMan/Properties/AssemblyInfo.cs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
3-
using System.Runtime.InteropServices;
42

53
// Information about this assembly is defined by the following attributes.
64
// Change them to the information which is associated with the assembly you compile.

‎External/Tools/AppMan/Utilities/ArgProcessor.cs‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
42
using System.IO;
53

64
namespace AppMan.Utilities
75
{
86
public class ArgProcessor
97
{
108
/// <summary>
11-
/// Processes the internal argruments in a string.
9+
/// Processes the internal arguments in a string.
1210
/// </summary>
13-
public static String ProcessArguments(String data)
11+
public static string ProcessArguments(string data)
1412
{
1513
data = data.Replace("$(Quote)", "\"");
1614
data = data.Replace("$(AppDir)", PathHelper.GetExeDirectory());
1715
#if FLASHDEVELOP
18-
String local = Path.Combine(PathHelper.GetExeDirectory(), @"..\..\.local");
16+
var local = Path.Combine(PathHelper.GetExeDirectory(), @"..\..\.local");
1917
local = Path.GetFullPath(local); /* Fix weird path */
2018
if (!File.Exists(local))
2119
{
22-
String userAppDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
23-
String fdUserPath = Path.Combine(userAppDir, MainForm.DISTRO_NAME);
20+
var userAppDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
21+
var fdUserPath = Path.Combine(userAppDir, MainForm.DISTRO_NAME);
2422
data = data.Replace("$(BaseDir)", fdUserPath);
2523
}
2624
else data = data.Replace("$(BaseDir)", Path.GetDirectoryName(local));
Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.IO;
3-
using System.Text;
4-
using System.Collections.Generic;
1+
using System.IO;
52
using System.Windows.Forms;
63

74
namespace AppMan.Utilities
@@ -11,12 +8,12 @@ public class DialogHelper
118
/// <summary>
129
/// Shows an error dialog to the user.
1310
/// </summary>
14-
public static void ShowError(String message)
11+
public static void ShowError(string message)
1512
{
1613
MessageBox.Show(message, " Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
1714
try
1815
{
19-
String logFile = Path.Combine(PathHelper.LOG_DIR, "Exceptions.log");
16+
var logFile = Path.Combine(PathHelper.LOG_DIR, "Exceptions.log");
2017
File.AppendAllText(logFile, message + "\n\r\n\r");
2118
}
2219
catch { /* NO ERRORS */ }
@@ -25,19 +22,11 @@ public static void ShowError(String message)
2522
/// <summary>
2623
/// Shows a warning dialog to the user.
2724
/// </summary>
28-
public static void ShowWarning(String message)
29-
{
30-
MessageBox.Show(message, " Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
31-
}
25+
public static void ShowWarning(string message) => MessageBox.Show(message, " Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
3226

3327
/// <summary>
34-
/// Shows an infromation dialog to the user.
28+
/// Shows an information dialog to the user.
3529
/// </summary>
36-
public static void ShowInformation(String message)
37-
{
38-
MessageBox.Show(message, " Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
39-
}
40-
30+
public static void ShowInformation(string message) => MessageBox.Show(message, " Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
4131
}
42-
43-
}
32+
}

‎External/Tools/AppMan/Utilities/ObjectSerializer.cs‎

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.IO;
33
using System.Text;
44
using System.Xml.Serialization;
5-
using System.Windows.Forms;
65

76
namespace AppMan.Utilities
87
{
@@ -11,13 +10,13 @@ public class ObjectSerializer
1110
/// <summary>
1211
/// Serializes the specified object to a xml file.
1312
/// </summary>
14-
public static void Serialize(String file, Object obj)
13+
public static void Serialize(string file, object obj)
1514
{
1615
try
1716
{
1817
using (TextWriter writer = new StreamWriter(file, false, Encoding.UTF8))
1918
{
20-
XmlSerializer serializer = new XmlSerializer(obj.GetType());
19+
var serializer = new XmlSerializer(obj.GetType());
2120
serializer.Serialize(writer, obj);
2221
}
2322
}
@@ -30,23 +29,21 @@ public static void Serialize(String file, Object obj)
3029
/// <summary>
3130
/// Deserializes the specified object from a xml file. Optionally exposes commented groups.
3231
/// </summary>
33-
public static Object Deserialize(String file, Object obj)
34-
{
35-
return Deserialize(file, obj, String.Empty);
36-
}
37-
public static Object Deserialize(String file, Object obj, String groups)
32+
public static object Deserialize(string file, object obj) => Deserialize(file, obj, string.Empty);
33+
34+
public static object Deserialize(string file, object obj, string groups)
3835
{
3936
try
4037
{
4138
using (TextReader reader = new StreamReader(file, Encoding.UTF8, false))
4239
{
43-
String xmlData = reader.ReadToEnd();
44-
String[] exGroups = groups.Split(new char[] { ',' });
45-
foreach (String group in exGroups)
40+
var xmlData = reader.ReadToEnd();
41+
var exGroups = groups.Split(',');
42+
foreach (var group in exGroups)
4643
{
4744
xmlData = xmlData.Replace("<!--" + group, "").Replace(group + "-->", "");
4845
}
49-
XmlSerializer serializer = new XmlSerializer(obj.GetType());
46+
var serializer = new XmlSerializer(obj.GetType());
5047
return serializer.Deserialize(new StringReader(xmlData));
5148
}
5249
}
@@ -56,7 +53,5 @@ public static Object Deserialize(String file, Object obj, String groups)
5653
return null;
5754
}
5855
}
59-
6056
}
61-
62-
}
57+
}
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.IO;
3-
using System.Text;
4-
using System.Collections.Generic;
1+
using System.IO;
52
using System.Windows.Forms;
63

74
namespace AppMan.Utilities
@@ -11,31 +8,26 @@ public class PathHelper
118
/// <summary>
129
/// Default path to the log dir.
1310
/// </summary>
14-
public static String LOG_DIR = ArgProcessor.ProcessArguments("$(AppDir)");
11+
public static string LOG_DIR = ArgProcessor.ProcessArguments("$(AppDir)");
1512

1613
/// <summary>
1714
/// Default path to the apps directory.
1815
/// </summary>
19-
public static String APPS_DIR = ArgProcessor.ProcessArguments("$(AppDir)/Apps");
16+
public static string APPS_DIR = ArgProcessor.ProcessArguments("$(AppDir)/Apps");
2017

2118
/// <summary>
2219
/// Default path to the app help.
2320
/// </summary>
24-
public static String HELP_ADR = ArgProcessor.ProcessArguments("$(AppDir)/Help.html");
21+
public static string HELP_ADR = ArgProcessor.ProcessArguments("$(AppDir)/Help.html");
2522

2623
/// <summary>
2724
/// Default path to the config xml file.
2825
/// </summary>
29-
public static String CONFIG_ADR = ArgProcessor.ProcessArguments("$(AppDir)/Config.xml");
26+
public static string CONFIG_ADR = ArgProcessor.ProcessArguments("$(AppDir)/Config.xml");
3027

3128
/// <summary>
3229
/// Gets the directory of the app.
3330
/// </summary>
34-
public static String GetExeDirectory()
35-
{
36-
return Path.GetDirectoryName(Application.ExecutablePath);
37-
}
38-
31+
public static string GetExeDirectory() => Path.GetDirectoryName(Application.ExecutablePath);
3932
}
40-
41-
}
33+
}

‎External/Tools/AppMan/Utilities/TaskbarProgress.cs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public enum TaskbarStates
1919
[ComImportAttribute()]
2020
[GuidAttribute("ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf")]
2121
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
22-
private interface ITaskbarList3
22+
interface ITaskbarList3
2323
{
2424
// ITaskbarList
2525
[PreserveSig]
@@ -37,18 +37,18 @@ private interface ITaskbarList3
3737
void MarkFullscreenWindow(IntPtr hwnd, [MarshalAs(UnmanagedType.Bool)] bool fFullscreen);
3838
// ITaskbarList3
3939
[PreserveSig]
40-
void SetProgressValue(IntPtr hwnd, UInt64 ullCompleted, UInt64 ullTotal);
40+
void SetProgressValue(IntPtr hwnd, ulong ullCompleted, ulong ullTotal);
4141
[PreserveSig]
4242
void SetProgressState(IntPtr hwnd, TaskbarStates state);
4343
}
4444

4545
[GuidAttribute("56FDF344-FD6D-11d0-958A-006097C9A090")]
4646
[ClassInterfaceAttribute(ClassInterfaceType.None)]
4747
[ComImportAttribute()]
48-
private class TaskbarInstance {}
48+
class TaskbarInstance {}
4949

50-
private static ITaskbarList3 taskbarInstance;
51-
private static Boolean taskbarSupported = (Environment.OSVersion.Version >= new Version(6, 1)) && !Win32.IsRunningOnMono;
50+
static ITaskbarList3 taskbarInstance;
51+
static readonly bool taskbarSupported = (Environment.OSVersion.Version >= new Version(6, 1)) && !Win32.IsRunningOnMono;
5252

5353
public static void SetState(IntPtr windowHandle, TaskbarStates taskbarState)
5454
{
@@ -67,7 +67,5 @@ public static void SetValue(IntPtr windowHandle, double progressValue, double pr
6767
taskbarInstance.SetProgressValue(windowHandle, (ulong)progressValue, (ulong)progressMax);
6868
}
6969
}
70-
7170
}
72-
73-
}
71+
}
Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using System;
22
using System.IO;
3-
using System.Text;
4-
using System.Collections.Generic;
53
using ICSharpCode.SharpZipLib.Zip;
6-
using System.Globalization;
74

85
namespace AppMan.Utilities
96
{
@@ -12,34 +9,33 @@ public class ZipHelper
129
/// <summary>
1310
/// Extracts a zip file to specified directory.
1411
/// </summary>
15-
public static void ExtractZip(String file, String path)
12+
public static void ExtractZip(string file, string path)
1613
{
1714
// Save current directory
18-
String curDir = Environment.CurrentDirectory;
15+
var curDir = Environment.CurrentDirectory;
1916
try
2017
{
21-
ZipEntry entry = null;
22-
ZipInputStream zis = new ZipInputStream(new FileStream(file, FileMode.Open, FileAccess.Read));
18+
ZipEntry entry;
19+
var zis = new ZipInputStream(new FileStream(file, FileMode.Open, FileAccess.Read));
2320
Environment.CurrentDirectory = path; // Used to work around long path issue
2421
while ((entry = zis.GetNextEntry()) != null)
2522
{
26-
Int32 size = 4096;
27-
Byte[] data = new Byte[4096];
23+
var data = new byte[4096];
2824
if (entry.IsFile)
2925
{
30-
String ext = Path.GetExtension(entry.Name);
31-
String dirPath = Path.GetDirectoryName(entry.Name);
32-
if (!String.IsNullOrEmpty(dirPath) && !Directory.Exists(dirPath))
26+
var dirPath = Path.GetDirectoryName(entry.Name);
27+
if (!string.IsNullOrEmpty(dirPath) && !Directory.Exists(dirPath))
3328
{
3429
Directory.CreateDirectory(dirPath);
3530
}
36-
FileStream extracted;
37-
String fullPath = Path.Combine(path, entry.Name);
38-
if (Win32.IsRunningOnMono) extracted = File.Open(fullPath, FileMode.Create, FileAccess.Write);
39-
else extracted = Win32.LongPathFileOpen(fullPath);
31+
32+
var fullPath = Path.Combine(path, entry.Name);
33+
var extracted = Win32.IsRunningOnMono
34+
? File.Open(fullPath, FileMode.Create, FileAccess.Write)
35+
: Win32.LongPathFileOpen(fullPath);
4036
while (true)
4137
{
42-
size = zis.Read(data, 0, data.Length);
38+
var size = zis.Read(data, 0, data.Length);
4339
if (size > 0) extracted.Write(data, 0, size);
4440
else break;
4541
}
@@ -59,7 +55,5 @@ public static void ExtractZip(String file, String path)
5955
// Restore current directory
6056
Environment.CurrentDirectory = curDir;
6157
}
62-
6358
}
64-
65-
}
59+
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL