Beispiel #1
0
 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);
         }
     }
 }
Beispiel #2
0
 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);
     }
 }