Fix some filenames from previous renames, and more attribute renames

This commit is contained in:
adelikat 2017-07-12 14:48:27 -05:00
parent 6e06947a33
commit 9cb44cad03
6 changed files with 12 additions and 12 deletions

View File

@ -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;
}

View File

@ -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()))
{

View File

@ -696,7 +696,7 @@
<Compile Include="Sound\Utilities\SyncToAsyncProvider.cs" />
<Compile Include="Sound\Utilities\SoundOutputProvider.cs" />
<Compile Include="Throttle.cs" />
<Compile Include="ToolAttributes.cs" />
<Compile Include="ToolAttribute.cs" />
<Compile Include="tools\AutoHawk.cs">
<SubType>Form</SubType>
</Compile>
@ -1173,7 +1173,7 @@
<Compile Include="tools\VirtualPads\schema\NesSchema.cs" />
<Compile Include="tools\VirtualPads\schema\PadSchema.cs" />
<Compile Include="tools\VirtualPads\schema\PceSchema.cs" />
<Compile Include="tools\VirtualPads\schema\SchemaAttributes.cs" />
<Compile Include="tools\VirtualPads\schema\SchemaAttribute.cs" />
<Compile Include="tools\VirtualPads\schema\SmsSchema.cs" />
<Compile Include="tools\VirtualPads\schema\SnesSchema.cs" />
<Compile Include="tools\VirtualPads\schema\VirtualBoySchema.cs" />

View File

@ -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
/// </summary>
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
{
}
}