Remove redundant attr class VideoWriterIgnoreAttribute

This commit is contained in:
YoshiRulz 2021-01-23 17:12:31 +10:00
parent a149b7e033
commit e24709f8fb
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 5 additions and 11 deletions

View File

@ -5,7 +5,6 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk
{
[VideoWriterIgnore]
public class AudioStretcher : AVStretcher
{
public AudioStretcher(IVideoWriter w)
@ -45,7 +44,6 @@ namespace BizHawk.Client.EmuHawk
}
}
[VideoWriterIgnore]
public class VideoStretcher : AVStretcher
{
public VideoStretcher(IVideoWriter w)

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Linq;
using BizHawk.Client.Common;
using BizHawk.Emulation.Common;
@ -115,11 +116,6 @@ namespace BizHawk.Client.EmuHawk
}
}
[AttributeUsage(AttributeTargets.Class)]
public sealed class VideoWriterIgnoreAttribute : Attribute
{
}
public class VideoWriterInfo
{
public VideoWriterAttribute Attribs { get; }
@ -149,10 +145,10 @@ namespace BizHawk.Client.EmuHawk
{
if (!t.IsInterface
&& typeof(IVideoWriter).IsAssignableFrom(t)
&& !t.IsAbstract
&& t.GetCustomAttributes(typeof(VideoWriterIgnoreAttribute), false).Length == 0)
&& !t.IsAbstract)
{
var a = (VideoWriterAttribute)t.GetCustomAttributes(typeof(VideoWriterAttribute), false)[0];
var a = t.GetCustomAttributes(typeof(VideoWriterAttribute), false).Cast<VideoWriterAttribute>().FirstOrDefault();
if (a == null) continue;
VideoWriters.Add(a.ShortName, new VideoWriterInfo(a, t));
}
}