Beispiel #1
0
 /// <summary>
 /// Detaches subsriber
 /// </summary>
 /// <param name="handler">Subscriber</param>
 public void DetachHandler(Event.IEventHandler handler)
 {
     _context.Logger.Log(this, "Detached a handler: " + LoggingHelpers.GetTypeOrName(handler), 5);
     _provider.DetachHandler(handler);
 }
Beispiel #2
0
 /// <summary>
 /// Invokes a term
 /// </summary>
 /// <param name="term">The term</param>
 protected void InvokeTerm(Term term)
 {
     _time = term.Time;
     _context.Logger.Log(this, String.Format("Invoking a term (time: {0}, state {1}, owner {2})", term.Time, term.State, LoggingHelpers.GetTypeOrName(term.Owner)), 5);
     term.Owner.Notify(new Event.Event(term.State, term.Data), this);
 }
Beispiel #3
0
 public void RemoveTerm(Term term)
 {
     _context.Logger.Log(this, String.Format("Removing a term (time: {0}, state {1}, owner {2})", term.Time, term.State, LoggingHelpers.GetTypeOrName(term.Owner)), 10);
     foreach (Term t in _terms)
     {
         if (t.EqualsTo(term))
         {
             _terms.Remove(t);
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// Add a new term for invocation
 /// </summary>
 /// <param name="term">The term</param>
 public void AddTerm(Term term)
 {
     _context.Logger.Log(this, String.Format("Adding a new term (time: {0}, state {1}, owner {2})", term.Time, term.State, LoggingHelpers.GetTypeOrName(term.Owner)), 8);
     if (term.Time < _time)
     {
         throw new ArgumentException("It's not possible to add a term based in past!");
     }
     else if (term.Time == _time)
     {
         InvokeTerm(term);
     }
     else
     {
         _terms.Add(term);
     }
 }