示例#1
0
 protected override void DisposeManagedResources()
 {
     foreach (var item in LifetimeManager.ManagedItems)
     {
         item.Dispose();
     }
     LifetimeManager = null;
 }
示例#2
0
 public void SubscribeForLifetime(Action handler, LifetimeManager lifetimeManager)
 {
     var sub = SubscribeUnmanaged(handler);
     lifetimeManager.Manage(sub);
 }
示例#3
0
 public Lifetime()
 {
     LifetimeManager = new LifetimeManager();
 }
示例#4
0
 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));
 }