Beispiel #1
0
 public void UnregisterAngleArea(ILeaveAngleAreaObserver ob, AngleArea area)
 {
     foreach (var p in Areas)
     {
         if (p.Key != ob || p.Value != area)
         {
             continue;
         }
         Areas.Remove(p);
         break;
     }
 }
Beispiel #2
0
        public void RegisterAngleArea(ILeaveAngleAreaObserver ob, AngleArea area)
        {
            foreach (var p in Areas)
            {
                if (p.Key == ob && p.Value == area)  //已经注册过
                {
                    return;
                }
            }

            var pair = new KeyValuePair <ILeaveAngleAreaObserver, AngleArea>(ob, area);

            Areas.Add(pair);
        }