Fix some filenames from previous renames, and more attribute renames
This commit is contained in:
parent
6e06947a33
commit
9cb44cad03
|
@ -81,9 +81,9 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Class)]
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
public class ImportExtension : Attribute
|
public class ImportExtensionAttribute : Attribute
|
||||||
{
|
{
|
||||||
public ImportExtension(string extension)
|
public ImportExtensionAttribute(string extension)
|
||||||
{
|
{
|
||||||
Extension = extension;
|
Extension = extension;
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
private static bool TypeImportsExtension(Type t, string ext)
|
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()))
|
if (attrs.Any(a => a.Extension.ToUpper() == ext.ToUpper()))
|
||||||
{
|
{
|
||||||
|
|
|
@ -696,7 +696,7 @@
|
||||||
<Compile Include="Sound\Utilities\SyncToAsyncProvider.cs" />
|
<Compile Include="Sound\Utilities\SyncToAsyncProvider.cs" />
|
||||||
<Compile Include="Sound\Utilities\SoundOutputProvider.cs" />
|
<Compile Include="Sound\Utilities\SoundOutputProvider.cs" />
|
||||||
<Compile Include="Throttle.cs" />
|
<Compile Include="Throttle.cs" />
|
||||||
<Compile Include="ToolAttributes.cs" />
|
<Compile Include="ToolAttribute.cs" />
|
||||||
<Compile Include="tools\AutoHawk.cs">
|
<Compile Include="tools\AutoHawk.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -1173,7 +1173,7 @@
|
||||||
<Compile Include="tools\VirtualPads\schema\NesSchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\NesSchema.cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\PadSchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\PadSchema.cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\PceSchema.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\SmsSchema.cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\SnesSchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\SnesSchema.cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\VirtualBoySchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\VirtualBoySchema.cs" />
|
||||||
|
|
|
@ -19,8 +19,8 @@ namespace BizHawk.Emulation.Common
|
||||||
object[] tmp = new object[1];
|
object[] tmp = new object[1];
|
||||||
|
|
||||||
foreach (var propinfo in
|
foreach (var propinfo in
|
||||||
targetType.GetPropertiesWithAttrib(typeof(RequiredService))
|
targetType.GetPropertiesWithAttrib(typeof(RequiredServiceAttribute))
|
||||||
.Concat(targetType.GetPropertiesWithAttrib(typeof(OptionalService))))
|
.Concat(targetType.GetPropertiesWithAttrib(typeof(OptionalServiceAttribute))))
|
||||||
{
|
{
|
||||||
propinfo.GetSetMethod(true).Invoke(target, tmp);
|
propinfo.GetSetMethod(true).Invoke(target, tmp);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Common
|
||||||
Type targetType = target.GetType();
|
Type targetType = target.GetType();
|
||||||
object[] tmp = new object[1];
|
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);
|
tmp[0] = source.GetService(propinfo.PropertyType);
|
||||||
if (tmp[0] == null)
|
if (tmp[0] == null)
|
||||||
|
@ -46,7 +46,7 @@ namespace BizHawk.Emulation.Common
|
||||||
propinfo.GetSetMethod(true).Invoke(target, tmp);
|
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);
|
tmp[0] = source.GetService(propinfo.PropertyType);
|
||||||
propinfo.GetSetMethod(true).Invoke(target, tmp);
|
propinfo.GetSetMethod(true).Invoke(target, tmp);
|
||||||
|
@ -61,19 +61,19 @@ namespace BizHawk.Emulation.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsAvailable(IEmulatorServiceProvider source, Type targetType)
|
public static bool IsAvailable(IEmulatorServiceProvider source, Type targetType)
|
||||||
{
|
{
|
||||||
return targetType.GetPropertiesWithAttrib(typeof(RequiredService))
|
return targetType.GetPropertiesWithAttrib(typeof(RequiredServiceAttribute))
|
||||||
.Select(pi => pi.PropertyType)
|
.Select(pi => pi.PropertyType)
|
||||||
.All(source.HasService);
|
.All(source.HasService);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
public class RequiredService : Attribute
|
public class RequiredServiceAttribute : Attribute
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
public class OptionalService : Attribute
|
public class OptionalServiceAttribute : Attribute
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue