Run StyleCop on the smaller projects.

Also add a copy of the rules to the CrashDialog and Irc projects.
This commit is contained in:
RoosterDragon
2014-06-23 00:03:37 +01:00
parent e41791568d
commit 38617dc0a9
17 changed files with 786 additions and 105 deletions

View File

@@ -91,10 +91,10 @@ namespace OpenRA.Utility
var shadowIndex = new int[] { };
if (args.Contains("--noshadow"))
{
Array.Resize(ref shadowIndex, shadowIndex.Length + 3);
shadowIndex[shadowIndex.Length - 1] = 1;
shadowIndex[shadowIndex.Length - 2] = 3;
shadowIndex[shadowIndex.Length - 3] = 4;
Array.Resize(ref shadowIndex, shadowIndex.Length + 3);
shadowIndex[shadowIndex.Length - 1] = 1;
shadowIndex[shadowIndex.Length - 2] = 3;
shadowIndex[shadowIndex.Length - 3] = 4;
}
var palette = Palette.Load(args[2], shadowIndex);
@@ -357,7 +357,7 @@ namespace OpenRA.Utility
var inner = outer.SelectMany(i => i.GetGenericArguments()).ToArray();
// Remove the namespace and the trailing "Info"
return inner.Select(i => i.Name.Split(new [] { '.' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault())
return inner.Select(i => i.Name.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault())
.Select(s => s.EndsWith("Info") ? s.Remove(s.Length - 4, 4) : s)
.ToArray();
}

View File

@@ -56,13 +56,12 @@ namespace OpenRA.Utility
if (translatables.Contains(node.Key) && !alreadyTranslated)
{
var translationKey = "{0}-{1}-{2}".F(container.Replace('_', '-'), parentLabel.Replace('_', '-'), node.Key.ToUpper());
Console.WriteLine("\t{0}: {1}", translationKey , node.Value.Value);
Console.WriteLine("\t{0}: {1}", translationKey, node.Value.Value);
node.Value.Value = "@{0}@".F(translationKey);
}
FromChromeLayout(ref node.Value.Nodes, node, translatables, container);
}
}
}
}

View File

@@ -37,9 +37,7 @@ namespace OpenRA.Utility
yield break;
}
//
// Split using DirectorySeparators but keep the separators
//
var parts = new List<string>();
for (var startIndex = 0; startIndex < filePath.Length;)

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Utility
{
class Program
{
static Dictionary<string, Action<string[]>> Actions = new Dictionary<string, Action<string[]>>()
static readonly Dictionary<string, Action<string[]>> Actions = new Dictionary<string, Action<string[]>>()
{
{ "--settings-value", Command.Settings },
{ "--shp", Command.ConvertPngToShp },

View File

@@ -316,7 +316,7 @@ namespace OpenRA.Utility
if (engineVersion < 20140615)
{
if (depth == 2 && parentKey == "Warhead" && node.Key == "Ore" )
if (depth == 2 && parentKey == "Warhead" && node.Key == "Ore")
node.Key = "DestroyResources";
}