예제 #1
0
 public void Raise(ModelBase triggered, string eventType, params object[] data)
 {
     System.Type t = ModelHelper.Instance.GetBase(triggered.GetType());
     ArrayList observers = (ArrayList)_observers[t];
     if (observers != null)
         foreach (IObserver observer in observers)
             observer.Notify(triggered, eventType, data);
 }
예제 #2
0
 public static Hashtable Marshal(ModelBase model)
 {
     Hashtable ret = new Hashtable();
     foreach (object k in model.Keys) {
         object value = model[k];
         if (value is ModelBase)
             value = Marshal(value as ModelBase);
         else if (value is ArrayList)
             value = Marshal(value as ArrayList);
         ret.Add(k, value);
     }
     return ret;
 }