From 9cb44cad03e2a1910e81b1f6fb40cf0722664dfa Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 12 Jul 2017 14:48:27 -0500 Subject: [PATCH] Fix some filenames from previous renames, and more attribute renames --- BizHawk.Client.Common/movie/import/IMovieImport.cs | 4 ++-- BizHawk.Client.Common/movie/import/MovieImport.cs | 2 +- .../BizHawk.Client.EmuHawk.csproj | 4 ++-- .../{ToolAttributes.cs => ToolAttribute.cs} | 0 .../{SchemaAttributes.cs => SchemaAttribute.cs} | 0 BizHawk.Emulation.Common/ServiceInjector.cs | 14 +++++++------- 6 files changed, 12 insertions(+), 12 deletions(-) rename BizHawk.Client.EmuHawk/{ToolAttributes.cs => ToolAttribute.cs} (100%) rename BizHawk.Client.EmuHawk/tools/VirtualPads/schema/{SchemaAttributes.cs => SchemaAttribute.cs} (100%) diff --git a/BizHawk.Client.Common/movie/import/IMovieImport.cs b/BizHawk.Client.Common/movie/import/IMovieImport.cs index 3f3f0bfafb..255b0e6477 100644 --- a/BizHawk.Client.Common/movie/import/IMovieImport.cs +++ b/BizHawk.Client.Common/movie/import/IMovieImport.cs @@ -81,9 +81,9 @@ namespace BizHawk.Client.Common } [AttributeUsage(AttributeTargets.Class)] - public class ImportExtension : Attribute + public class ImportExtensionAttribute : Attribute { - public ImportExtension(string extension) + public ImportExtensionAttribute(string extension) { Extension = extension; } diff --git a/BizHawk.Client.Common/movie/import/MovieImport.cs b/BizHawk.Client.Common/movie/import/MovieImport.cs index af8e69db52..33eb7b1e73 100644 --- a/BizHawk.Client.Common/movie/import/MovieImport.cs +++ b/BizHawk.Client.Common/movie/import/MovieImport.cs @@ -129,7 +129,7 @@ namespace BizHawk.Client.Common private static bool TypeImportsExtension(Type t, string ext) { - var attrs = (ImportExtension[])t.GetCustomAttributes(typeof(ImportExtension), inherit: false); + var attrs = (ImportExtensionAttribute[])t.GetCustomAttributes(typeof(ImportExtensionAttribute), inherit: false); if (attrs.Any(a => a.Extension.ToUpper() == ext.ToUpper())) { diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index 921a549dda..7523fd97fd 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -696,7 +696,7 @@ - + Form @@ -1173,7 +1173,7 @@ - + diff --git a/BizHawk.Client.EmuHawk/ToolAttributes.cs b/BizHawk.Client.EmuHawk/ToolAttribute.cs similarity index 100% rename from BizHawk.Client.EmuHawk/ToolAttributes.cs rename to BizHawk.Client.EmuHawk/ToolAttribute.cs diff --git a/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SchemaAttributes.cs b/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SchemaAttribute.cs similarity index 100% rename from BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SchemaAttributes.cs rename to BizHawk.Client.EmuHawk/tools/VirtualPads/schema/SchemaAttribute.cs diff --git a/BizHawk.Emulation.Common/ServiceInjector.cs b/BizHawk.Emulation.Common/ServiceInjector.cs index 8271b1761e..15ffb76f85 100644 --- a/BizHawk.Emulation.Common/ServiceInjector.cs +++ b/BizHawk.Emulation.Common/ServiceInjector.cs @@ -19,8 +19,8 @@ namespace BizHawk.Emulation.Common object[] tmp = new object[1]; foreach (var propinfo in - targetType.GetPropertiesWithAttrib(typeof(RequiredService)) - .Concat(targetType.GetPropertiesWithAttrib(typeof(OptionalService)))) + targetType.GetPropertiesWithAttrib(typeof(RequiredServiceAttribute)) + .Concat(targetType.GetPropertiesWithAttrib(typeof(OptionalServiceAttribute)))) { propinfo.GetSetMethod(true).Invoke(target, tmp); } @@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Common Type targetType = target.GetType(); object[] tmp = new object[1]; - foreach (var propinfo in targetType.GetPropertiesWithAttrib(typeof(RequiredService))) + foreach (var propinfo in targetType.GetPropertiesWithAttrib(typeof(RequiredServiceAttribute))) { tmp[0] = source.GetService(propinfo.PropertyType); if (tmp[0] == null) @@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Common propinfo.GetSetMethod(true).Invoke(target, tmp); } - foreach (var propinfo in targetType.GetPropertiesWithAttrib(typeof(OptionalService))) + foreach (var propinfo in targetType.GetPropertiesWithAttrib(typeof(OptionalServiceAttribute))) { tmp[0] = source.GetService(propinfo.PropertyType); propinfo.GetSetMethod(true).Invoke(target, tmp); @@ -61,19 +61,19 @@ namespace BizHawk.Emulation.Common /// public static bool IsAvailable(IEmulatorServiceProvider source, Type targetType) { - return targetType.GetPropertiesWithAttrib(typeof(RequiredService)) + return targetType.GetPropertiesWithAttrib(typeof(RequiredServiceAttribute)) .Select(pi => pi.PropertyType) .All(source.HasService); } } [AttributeUsage(AttributeTargets.Property)] - public class RequiredService : Attribute + public class RequiredServiceAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property)] - public class OptionalService : Attribute + public class OptionalServiceAttribute : Attribute { } }