コード例 #1
0
 public void AddService(ChangedService service)
 {
     if (service == null)
     {
         return;
     }
     if (services == null)
     {
         services = new List <ChangedService>();
     }
     service._isFireAcceptedChangedEvent = false;
     service.ModelChanged += new EventHandler(service_ModelChanged);
     services.Add(service);
 }
コード例 #2
0
 public void RemoveService(ChangedService service)
 {
     if (service == null)
     {
         return;
     }
     if (services == null)
     {
         return;
     }
     if (!services.Contains(service))
     {
         return;
     }
     service.ModelChanged -= service_ModelChanged;
     services.Remove(service);
     if (services.Count == 0)
     {
         services = null;
     }
 }