dont' use ThrowsError when deciding if a method is implemented. Simply checking for an exception is no longer reliable sinc most GetSamplesAsync() methods correctly do this by design

This commit is contained in:
adelikat 2017-02-08 17:48:32 -06:00
parent eb1f477f9d
commit f640271a47
1 changed files with 7 additions and 1 deletions

View File

@ -342,8 +342,14 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
return false;
}
// adelikat: we can't rely on this anymore
// Some methods throw an exception by design, such as ISoundProvider.GetSamplesAsync()
// If async is not provided by the implementation this method will throw an exception
// We need to figure out a reliable way to check specifically for a NotImplementedException, then maybe this method will be more useful
// If a method is not marked but all it does is throw an exception, consider it not implemented
return !info.ThrowsError();
//return !info.ThrowsError();
return true;
}
public static bool IsImplemented(this PropertyInfo info)