protected override void DisposeManagedResources() { foreach (var item in LifetimeManager.ManagedItems) { item.Dispose(); } LifetimeManager = null; }
public void SubscribeForLifetime(Action handler, LifetimeManager lifetimeManager) { var sub = SubscribeUnmanaged(handler); lifetimeManager.Manage(sub); }
public Lifetime() { LifetimeManager = new LifetimeManager(); }
public void PushForLifetime(ConsoleKey key, ConsoleModifiers? modifier, Action handler, LifetimeManager manager) { PushForLifetime(key, modifier, (k) => { handler(); }, manager); }
public void PushForLifetime(ConsoleKey key, ConsoleModifiers? modifier, Action<ConsoleKeyInfo> handler, LifetimeManager manager) { manager.Manage(PushUnmanaged(key, modifier, handler)); }