private void CompleteServiceSynchronous(IExecutive exec, object userdata) { CustomerSynchronous customer = (CustomerSynchronous)userdata; TellerState.ToState(Basic.TellerState.Idle); customer.FinishService(); Console.WriteLine("{0} : {1} finishing service of customer {2}.", m_model.Executive.Now, Name, customer.GetHashCode()); }
internal void StartServiceSynchronous(CustomerSynchronous customer) { TellerState.ToState(Basic.TellerState.Busy); DateTime completeWhen = m_model.Executive.Now + TimeSpan.FromMinutes(ServiceTime.GetNext()); m_model.Executive.RequestEvent(CompleteServiceSynchronous, completeWhen, customer); // Using userData to pass the customer to the event recipient. Console.WriteLine("{0} : {1} starting service of customer {2}.", m_model.Executive.Now, Name, customer.GetHashCode()); }