private void setHandler(int index, EHBlock handler) { if ((handler.Parent != null && handler.Parent != Parent) || (handler.tryBlock != null)) throw new HandlerAdditionProhibitedException(this,handler); EHBlock oldHandler = handlers[index] as EHBlock; if (oldHandler != null) oldHandler.tryBlock = null; handlers[index] = handler; handler.tryBlock = this; handler.setParent(Parent); }
public void InsertHandler(int index,EHBlock handler) { handlers.Insert(index,null); setHandler(index,handler); }
public void RemoveHandler(EHBlock handler) { handlers.Remove(handler); handler.tryBlock = null; }
public void AddHandler(EHBlock handler) { handlers.Add(null); setHandler(handlers.Count-1,handler); }