私はこのコードに出くわしました:
public class ServiceLauncher2 : ServiceBase, IDisposable
そして、これ:
/// <summary>
/// Disposes the controllers
/// </summary>
// This is declared new as opposed to override because the base class has to be able to
// call its own Dispose(bool) method and not this one. We could just as easily name
// this method something different, but keeping it Dispose is just as valid.
public new void Dispose()
{
foreach (var mgr in _threadManagers)
mgr.Dispose();
base.Dispose();
}
これまで Windows サービスの実装でこれを見たことがありません。通常、OnStop/OnStart だけがオーバーライドされます。これは悪い習慣ですか?