将界面拆分成几个:
public interface IPluginInterface : IEquatable<IPluginInterface>
{
string Maker { get; }
string Version { get; }
}
public interface IPluginWithOptionA : IPluginInterface
{
void Do();
}
public interface IPluginWithOptionB : IPluginInterface
{
void Do_two();
}
您可以实现一个或多个接口
public class MyPlugin : IPluginWithOptionA, IPluginWithOptionB
{
public bool Equals(IPluginInterface other)
{
throw new NotImplementedException();
}
public string Maker
{
get { throw new NotImplementedException(); }
}
public string Version
{
get { throw new NotImplementedException(); }
}
public void Do_two()
{
throw new NotImplementedException();
}
public void Do()
{
throw new NotImplementedException();
}
}