Permalink
Browse files

Tidied code with ReSharper.

  • Loading branch information...
1 parent b30260f commit cafb69810722fc6b346e1e5b957d1ec12b21d22c polyethene committed May 18, 2010
Showing with 676 additions and 823 deletions.
  1. +5 −3 Deploy/Bundle.cs
  2. +9 −8 Deploy/Docs.cs
  3. +9 −7 Deploy/Installer.cs
  4. +4 −2 Deploy/Package.cs
  5. +2 −2 Deploy/Program.cs
  6. +6 −6 IronAHK/Program.cs
  7. +2 −3 IronAHK/Properties/AssemblyInfo.cs
  8. +26 −16 IronAHK/Site/docs/commands/doc.xsl
  9. +63 −47 IronAHK/Site/docs/commands/view.xsl
  10. +2 −2 IronAHK/Test.cs
  11. +10 −11 Rusty/Core/Accessors.cs
  12. +12 −12 Rusty/Core/Common/Formats.cs
  13. +56 −85 Rusty/Core/Common/KeyboardHook.cs
  14. +6 −4 Rusty/Core/Common/Properties.cs
  15. +7 −7 Rusty/Core/Disk.cs
  16. +27 −25 Rusty/Core/Flow.cs
  17. +2 −2 Rusty/Core/Gui/Dialogs.cs
  18. +33 −36 Rusty/Core/Gui/Gui.cs
  19. +25 −25 Rusty/Core/Gui/HotkeyBox.cs
  20. +4 −20 Rusty/Core/Gui/Info.cs
  21. +1 −2 Rusty/Core/Gui/StatusBar.cs
  22. +3 −3 Rusty/Core/Helpers.cs
  23. +2 −2 Rusty/Core/Ini.cs
  24. +2 −4 Rusty/Core/Keyboard.cs
  25. +4 −4 Rusty/Core/Loop.cs
  26. +6 −8 Rusty/Core/Math.cs
  27. +7 −7 Rusty/Core/Mouse.cs
  28. +5 −4 Rusty/Core/Obsolete.cs
  29. +9 −11 Rusty/Core/PInvoke.cs
  30. +5 −4 Rusty/Core/Process.cs
  31. +3 −3 Rusty/Core/Screen.cs
  32. +1 −1 Rusty/Core/Sound.cs
  33. +7 −7 Rusty/Core/String.cs
  34. +3 −3 Rusty/Core/Variables.cs
  35. +5 −6 Rusty/Core/Window.cs
  36. +4 −4 Rusty/Extras/SimpleJson/Decode.cs
  37. +5 −5 Rusty/Extras/SimpleJson/Encode.cs
  38. +10 −10 Rusty/Linux/KeyboardHook.cs
  39. +60 −61 Rusty/Linux/Mapping.cs
  40. +0 −3 Rusty/Linux/PlatformInvokes.cs
  41. +1 −29 Rusty/Linux/Structs.cs
  42. +2 −3 Rusty/Properties/AssemblyInfo.cs
  43. +2 −2 Rusty/Windows/Input.cs
  44. +2 −2 Rusty/Windows/KeyboardHook.cs
  45. +11 −11 Rusty/Windows/Windows.cs
  46. +4 −4 Scripting/Compiler/Compiler.cs
  47. +5 −7 Scripting/Compiler/CompilerSetup.cs
  48. +3 −3 Scripting/Compiler/Emission/EmitCall.cs
  49. +2 −2 Scripting/Compiler/Emission/EmitLabel.cs
  50. +1 −1 Scripting/Compiler/Emission/EmitLoop.cs
  51. +3 −2 Scripting/Compiler/Emission/EmitVars.cs
  52. +5 −5 Scripting/Compiler/Emission/MethodSetup.cs
  53. +4 −4 Scripting/Compiler/Emission/MethodWriter.cs
  54. +1 −5 Scripting/Compiler/MethodCollection.cs
  55. +2 −2 Scripting/Compiler/Peripheral/TypeEmitter.cs
  56. +0 −1 Scripting/Generator/Code.cs
  57. +2 −2 Scripting/Generator/Emission/Emit.cs
  58. +6 −5 Scripting/Generator/Emission/Expression.cs
  59. +7 −7 Scripting/Generator/Emission/Operators.cs
  60. +3 −3 Scripting/Generator/Identifier.cs
  61. +0 −1 Scripting/Generator/Type.cs
  62. +4 −4 Scripting/IACodeProvider.cs
  63. +5 −15 Scripting/Parser/CodeDom/CodeBlock.cs
  64. +2 −2 Scripting/Parser/CodeDom/CodeComplexAssignStatement.cs
  65. +4 −5 Scripting/Parser/CodeDom/CodeComplexVariableReferenceExpression.cs
  66. +3 −9 Scripting/Parser/CodeDom/CodeLine.cs
  67. +7 −21 Scripting/Parser/CodeDom/CodeTernaryOperatorExpression.cs
  68. +3 −3 Scripting/Parser/Construct/Command.cs
  69. +8 −8 Scripting/Parser/Construct/Directive.cs
  70. +7 −7 Scripting/Parser/Construct/Expression.cs
  71. +4 −4 Scripting/Parser/Construct/Expressions/Object.cs
  72. +3 −3 Scripting/Parser/Construct/Expressions/Set.cs
  73. +2 −2 Scripting/Parser/Construct/Expressions/Texts.cs
  74. +14 −13 Scripting/Parser/Construct/Flow.cs
  75. +2 −2 Scripting/Parser/Construct/Function.cs
  76. +3 −4 Scripting/Parser/Construct/Hotkey.cs
  77. +1 −3 Scripting/Parser/Exception.cs
  78. +6 −6 Scripting/Parser/Helpers/InternalMethods.cs
  79. +6 −5 Scripting/Parser/Helpers/Invokes.cs
  80. +2 −2 Scripting/Parser/Helpers/MethodReference.cs
  81. +3 −3 Scripting/Parser/Helpers/Scope.cs
  82. +6 −6 Scripting/Parser/Helpers/Translate.cs
  83. +4 −3 Scripting/Parser/Helpers/Variables.cs
  84. +2 −2 Scripting/Parser/Parser.cs
  85. +3 −3 Scripting/Parser/Read.cs
  86. +2 −2 Scripting/Parser/Texts/Persistent.cs
  87. +4 −4 Scripting/Parser/Texts/String.cs
  88. +5 −5 Scripting/Parser/Texts/Token.cs
  89. +3 −3 Scripting/Parser/Texts/Types.cs
  90. +2 −3 Scripting/Properties/AssemblyInfo.cs
  91. +6 −6 Scripting/Script/Conversion.cs
  92. +1 −1 Scripting/Script/Labels.cs
  93. +3 −3 Scripting/Script/Objects.cs
  94. +11 −11 Scripting/Script/Operate.cs
  95. +2 −3 Tests/Properties/AssemblyInfo.cs
  96. +1 −2 Tests/Rusty/Accessors.cs
  97. +0 −4 Tests/Rusty/Disk.cs
  98. +0 −4 Tests/Rusty/Environment.cs
  99. +0 −4 Tests/Rusty/Flow.cs
  100. +0 −4 Tests/Rusty/Gui.cs
  101. +0 −4 Tests/Rusty/Ini.cs
  102. +0 −4 Tests/Rusty/Json.cs
  103. +0 −4 Tests/Rusty/Keyboard.cs
  104. +9 −9 Tests/Rusty/Math.cs
  105. +0 −4 Tests/Rusty/Mouse.cs
  106. +0 −4 Tests/Rusty/Process.cs
  107. +0 −4 Tests/Rusty/Registery.cs
  108. +0 −4 Tests/Rusty/Screen.cs
  109. +0 −4 Tests/Rusty/Sound.cs
  110. +0 −4 Tests/Rusty/String.cs
  111. +0 −4 Tests/Rusty/Window.cs
  112. +5 −4 Tests/Scripting/Scripting.cs
View
@@ -1,4 +1,6 @@
-using System.IO;
+using System.IO;
+using IronAHK.Rusty;
+using IronAHK.Scripting;
namespace IronAHK.Setup
{
@@ -11,12 +13,12 @@ static void AppBundle()
string tmp = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
string root = Path.Combine(tmp, name);
string res = Path.Combine(Path.Combine(root, "Contents"), "Resources");
- string favicon = string.Format("..{0}..{0}..{0}{1}{0}Site{0}favicon.ico", Path.DirectorySeparatorChar.ToString(), Name);
+ string favicon = string.Format("..{0}..{0}..{0}{1}{0}Site{0}favicon.ico", Path.DirectorySeparatorChar, Name);
if (!Directory.Exists(res))
Directory.CreateDirectory(res);
- foreach (var dll in new[] { typeof(Rusty.Core), typeof(Scripting.IACodeProvider) })
+ foreach (var dll in new[] { typeof(Core), typeof(IACodeProvider) })
File.Copy(dll.Assembly.Location, Path.Combine(res, Path.GetFileName(dll.Assembly.Location)));
foreach (var path in new[] { favicon, Name + ".exe" })
View
@@ -1,22 +1,23 @@
-using System.IO;
+using System.IO;
using System.Xml;
using System.Xml.Xsl;
+using IronAHK.Rusty;
namespace IronAHK.Setup
{
partial class Program
{
static void TransformDocs()
{
- string root = string.Format("..{0}..{0}..{0}{1}{0}Site{0}docs{0}commands", Path.DirectorySeparatorChar.ToString(), Name);
+ string root = string.Format("..{0}..{0}..{0}{1}{0}Site{0}docs{0}commands", Path.DirectorySeparatorChar, Name);
var xsl = new XslCompiledTransform();
- xsl.Load(XmlReader.Create(Path.Combine(root, "view.xsl"), new XmlReaderSettings() { ProhibitDtd = false }));
+ xsl.Load(XmlReader.Create(Path.Combine(root, "view.xsl"), new XmlReaderSettings { ProhibitDtd = false }));
- string prefix = string.Format("M:{0}.", typeof(Rusty.Core).FullName), assembly = typeof(Rusty.Core).Namespace;
+ string prefix = string.Format("M:{0}.", typeof(Core).FullName), assembly = typeof(Core).Namespace;
const string index = "index", srcName = index + ".xml", htmlName = index + ".html", member = "member";
- foreach (string path in Directory.GetDirectories(root))
+ foreach (var path in Directory.GetDirectories(root))
{
RemoveCommonPaths(path, srcName, htmlName);
Directory.Delete(path, false);
@@ -26,13 +27,13 @@ static void TransformDocs()
if (!File.Exists(xml))
{
- string parent = Path.GetFullPath(Path.Combine(WorkingDir, string.Format("..{0}..{0}..", Path.DirectorySeparatorChar.ToString())));
+ string parent = Path.GetFullPath(Path.Combine(WorkingDir, string.Format("..{0}..{0}..", Path.DirectorySeparatorChar)));
string diff = Path.GetDirectoryName(Path.GetFullPath(xml)).Substring(parent.Length + 1);
diff = diff.Replace("Deploy", assembly.Substring(Name.Length + 1));
xml = Path.Combine(Path.Combine(parent, diff), xml);
}
- var reader = XmlTextReader.Create(xml);
+ var reader = XmlReader.Create(xml);
reader.ReadToDescendant(member);
do
@@ -76,7 +77,7 @@ static void TransformDocs()
static void RemoveCommonPaths(string parent, params string[] files)
{
- foreach (string file in files)
+ foreach (var file in files)
{
string path = Path.Combine(parent, file);
View
@@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+using IronAHK.Rusty;
+using IronAHK.Scripting;
namespace IronAHK.Setup
{
@@ -24,7 +26,7 @@ static void BuildMsi(bool x64)
BuildMsi(src, x64);
src.Close();
- string dir = string.Format("..{0}..{0}WiX", Path.DirectorySeparatorChar.ToString());
+ string dir = string.Format("..{0}..{0}WiX", Path.DirectorySeparatorChar);
if (Directory.Exists(dir))
Environment.SetEnvironmentVariable("PATH", string.Concat(Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator.ToString(), dir));
@@ -75,7 +77,7 @@ static void BuildMsi(TextWriter writer, bool x64)
string version = Version;
string path = Path.GetFullPath(string.Format("..{0}..{0}..{0}{1}{0}bin{0}" + config, Path.DirectorySeparatorChar, name));
string docs = Path.GetFullPath(string.Format("{1}{0}..{0}..{0}Site{0}docs", Path.DirectorySeparatorChar, path));
- string favicon = string.Format("{1}{0}..{0}favicon.ico", Path.DirectorySeparatorChar.ToString(), docs);
+ string favicon = string.Format("{1}{0}..{0}favicon.ico", Path.DirectorySeparatorChar, docs);
string main = name + ".exe";
const string license = "license.txt";
const string licenseRtf = "license.rtf";
@@ -92,7 +94,7 @@ static void BuildMsi(TextWriter writer, bool x64)
writer.WriteLine(" <Directory Id='ProgramFiles{0}Folder' Name='ProgramFiles{0}Folder'>", x64 ? "64" : string.Empty);
writer.WriteLine(" <Directory Id='INSTALLDIR' Name='{0}'>", name);
- foreach (var dll in new[] { typeof(Rusty.Core), typeof(Scripting.IACodeProvider) })
+ foreach (var dll in new[] { typeof(Core), typeof(IACodeProvider) })
{
writer.WriteLine(" <Component Id='{0}' Guid='{1}'>", IdL, Guid);
writer.WriteLine(" <File Id='{0}' Source='{1}' KeyPath='yes' Assembly='.net' AssemblyManifest='{0}' />", Id, dll.Assembly.Location);
@@ -135,7 +137,7 @@ static void BuildMsi(TextWriter writer, bool x64)
writer.WriteLine(" </Directory>");
writer.WriteLine(" <Feature Id='{0}' Title='Complete' Absent='allow' Level='1'>", Id);
- foreach (string item in components)
+ foreach (var item in components)
writer.WriteLine(" <ComponentRef Id='{0}' />", item);
writer.WriteLine(" </Feature>");
@@ -171,15 +173,15 @@ static void RecurseTree(TextWriter writer, string parent, string root)
int offset = Directory.GetParent(root).FullName.Length + 1;
const string sp = " ";
- foreach (string dir in Directory.GetDirectories(parent))
+ foreach (var dir in Directory.GetDirectories(parent))
{
string sub = Path.GetFullPath(dir).Substring(offset).Replace(Path.DirectorySeparatorChar, '.');
writer.WriteLine(sp + "<Directory Id='INSTALLDIR.{0}' Name='{1}'>", sub, Path.GetFileName(dir));
RecurseTree(writer, dir, root);
writer.WriteLine(sp + "</Directory>");
}
- foreach (string file in Directory.GetFiles(parent))
+ foreach (var file in Directory.GetFiles(parent))
{
writer.WriteLine(sp + "<Component Id='{0}' Guid='{1}'>", IdL, Guid);
writer.WriteLine(sp + " <File Id='{0}' Source='{1}' />", Id, file);
@@ -194,7 +196,7 @@ static string Guid
static string Id
{
- get { return "c" + c++.ToString(); }
+ get { return "c" + c++; }
}
static string IdL
View
@@ -1,4 +1,6 @@
-using System.IO;
+using System.IO;
+using IronAHK.Rusty;
+using IronAHK.Scripting;
namespace IronAHK.Setup
{
@@ -12,7 +14,7 @@ static void PackageZip()
if (!Directory.Exists(target))
Directory.CreateDirectory(target);
- foreach (var dll in new[] { typeof(Rusty.Core), typeof(Scripting.IACodeProvider) })
+ foreach (var dll in new[] { typeof(Core), typeof(IACodeProvider) })
File.Copy(dll.Assembly.Location, Path.Combine(target, Path.GetFileName(dll.Assembly.Location)));
foreach (var file in new[] { "license.txt", "Example.ahk", "setup.sh", Name + ".exe" })
View
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
@@ -98,7 +98,7 @@ static string Output
{
get
{
- string path = string.Format("..{0}..{0}..{0}bin", Path.DirectorySeparatorChar.ToString());
+ string path = string.Format("..{0}..{0}..{0}bin", Path.DirectorySeparatorChar);
path = Path.GetFullPath(Path.Combine(WorkingDir, path));
if (!Directory.Exists(path))
View
@@ -95,8 +95,8 @@ static int Main(string[] args)
{
exe = null;
- var saveas = new SaveFileDialog()
- {
+ var saveas = new SaveFileDialog
+ {
AddExtension = true,
AutoUpgradeEnabled = true,
CheckPathExists = true,
@@ -120,7 +120,7 @@ static int Main(string[] args)
case "VERSION":
case "V":
string vers = string.Format("{0} {1}",
- typeof(Program).Namespace, Assembly.GetExecutingAssembly().GetName().Version.ToString());
+ typeof(Program).Namespace, Assembly.GetExecutingAssembly().GetName().Version);
return Message(vers, ExitSuccess);
case "HELP":
@@ -139,7 +139,7 @@ static int Main(string[] args)
{
if (gui)
{
- string[] docs = new[]
+ var docs = new[]
{
Path.Combine(Path.GetDirectoryName(self), Path.Combine("docs", "index.html")),
string.Format("..{0}..{0}Site{0}docs{0}index.html", Path.DirectorySeparatorChar),
@@ -201,10 +201,10 @@ static int Main(string[] args)
if (!error.IsWarning)
{
failed = true;
- warnings.WriteLine("{0}:{1} - {2}", Path.GetFileName(file), error.Line.ToString(), error.ErrorText);
+ warnings.WriteLine("{0}:{1} - {2}", Path.GetFileName(file), error.Line, error.ErrorText);
}
- Console.Error.WriteLine("{0} ({1}): ==> {2}", file, error.Line.ToString(), error.ErrorText);
+ Console.Error.WriteLine("{0} ({1}): ==> {2}", file, error.Line, error.ErrorText);
}
if (failed)
@@ -1,5 +1,4 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
+using System.Reflection;
using System.Runtime.InteropServices;
using System.Resources;
@@ -11,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IronAHK")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyCopyright("Copyright © 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -1,35 +1,43 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="c">
<code>
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</code>
</xsl:template>
<xsl:template match="para">
<p>
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</p>
</xsl:template>
<xsl:template match="see">
<a>
- <xsl:attribute name="href"><xsl:text>../</xsl:text><xsl:value-of select="@cref"/><xsl:text>/</xsl:text></xsl:attribute>
- <xsl:apply-templates/>
+ <xsl:attribute name="href">
+ <xsl:text>../</xsl:text>
+ <xsl:value-of select="@cref" />
+ <xsl:text>/</xsl:text>
+ </xsl:attribute>
+ <xsl:apply-templates />
</a>
</xsl:template>
<xsl:template match="code">
<pre>
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</pre>
</xsl:template>
<xsl:template match="example">
<div class="example">
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="paramref">
<a>
- <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="@name"/></xsl:attribute>
- <xsl:apply-templates/>
+ <xsl:attribute name="href">
+ <xsl:text>#</xsl:text>
+ <xsl:value-of select="@name" />
+ </xsl:attribute>
+ <xsl:apply-templates />
</a>
</xsl:template>
<xsl:template match="list">
@@ -38,7 +46,7 @@
<ul>
<xsl:for-each select="item">
<li>
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</li>
</xsl:for-each>
</ul>
@@ -47,7 +55,7 @@
<ol>
<xsl:for-each select="item">
<li>
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</li>
</xsl:for-each>
</ol>
@@ -56,15 +64,17 @@
<xsl:if test="listheader">
<tr>
<xsl:for-each select="listheader/term">
- <th><xsl:apply-templates/>
+ <th>
+ <xsl:apply-templates />
</th>
</xsl:for-each>
</tr>
</xsl:if>
<xsl:for-each select="item">
<tr>
<xsl:for-each select="term">
- <td><xsl:apply-templates/>
+ <td>
+ <xsl:apply-templates />
</td>
</xsl:for-each>
</tr>
@@ -74,12 +84,12 @@
</xsl:template>
<xsl:template match="item">
<dfn>
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</dfn>
</xsl:template>
<xsl:template match="description">
<span class="description">
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</span>
</xsl:template>
-</xsl:stylesheet>
+</xsl:stylesheet>
Oops, something went wrong.

0 comments on commit cafb698

Please sign in to comment.