Exemplo n.º 1
0
        /// <summary>
        /// returns true if the update was successful
        /// </summary>
        /// <param name="jobConfirmation"></param>
        /// <returns></returns>
        public bool UpdateJob(IConfirmation jobConfirmation)
        {
            if (IsSet && Current.Key.Equals(jobConfirmation.Key))
            {
                Current = Current.UpdateJob(jobConfirmation.Job);
                //ExpectedResourceIsBusyUntil = jobConfirmation.ScopeConfirmation.GetScopeEnd();
                return(true);
            }

            var(key, ready) = ReadyElements.FirstOrDefault(x => x.Value.Key.Equals(jobConfirmation.Key));
            if (ready == null)
            {
                return(false);
            }
            ReadyElements.Remove(key);
            ReadyElements.Add(key, ready.UpdateJob(jobConfirmation.Job));
            return(true);
        }
Exemplo n.º 2
0
 public void Add(IConfirmation confirmation)
 {
     ReadyElements.Add(confirmation.ScopeConfirmation.GetScopeStart(), confirmation);
 }