/** * Throws the model as an event to the listeners * @param model to be thrown */ private void ThrowEvent(Model model) { IEnumerator i = listeners.GetEnumerator(); while (i.MoveNext()) { ModelFactoryListener mfl = (ModelFactoryListener)i.Current; mfl.Process(model); } }
/** * register a ModelFactoryListener so that it can receive * Models as they are created. */ public void RegisterListener(ModelFactoryListener listener) { listeners.Add(listener); }