protected void Unregister(Invokeable i) { if (InvokeRequired) { Invoke(new SC.Messaging.Delegate <Invokeable>(Register), i); } else { System.Diagnostics.Debug.Assert(invokeables.Contains(i)); if (invokeables.Contains(i)) { i.DetachTask(); invokeables.Remove(i); } } }
protected void Register(Invokeable i) { if (InvokeRequired) { Invoke(new SC.Messaging.Delegate <Invokeable>(Register), i); } else { System.Diagnostics.Debug.Assert(!invokeables.Contains(i)); if (invokeables.Contains(i)) { throw new ArgumentException("Invokeable is already associated with InvokeableTask"); } i.AttachTask(this); invokeables.Add(i); } }