Example #1
0
 /// <summary>
 /// Attempt to acquire one or more consumable items from a
 /// <see cref="Consumable"/> on behalf of a client <see cref="DesTask"/>.
 /// </summary>
 /// <param name="activator">
 /// The object that activated this <see cref="AcquireConsumable"/> DesTask.
 /// </param>
 /// <param name="data">
 /// Not used.  The <paramref name="activator"/> should normally pass
 /// <see langword="null"/> for this parameter.
 /// </param>
 protected override void ExecuteTask(object activator, object data)
 {
     System.Diagnostics.Debug.Assert(activator != Blocker);
     if (!_requestMade)
     {
         if (Client != null)
         {
             _requestMade = true;
             if (!Blocker.RemoveUnits(this) && MaxWait > 0)
             {
                 Activate(null, MaxWait, null, Priority);
             }
         }
     }
     else
     {
         ResumeAll();
     }
 }