Esempio n. 1
0
     private void FixupDispatchRegion(DispatchRegion previousValue, bool skipKeys = false)
     {
         if (IsDeserializing)
         {
             return;
         }
 
         if (previousValue != null && previousValue.DispatchUsers.Contains(this))
         {
             previousValue.DispatchUsers.Remove(this);
         }
 
         if (DispatchRegion != null)
         {
             if (!DispatchRegion.DispatchUsers.Contains(this))
             {
                 DispatchRegion.DispatchUsers.Add(this);
             }
 
             RegionId = DispatchRegion.Id;
         }
         else if (!skipKeys)
         {
             RegionId = null;
         }
 
         if (ChangeTracker.ChangeTrackingEnabled)
         {
             if (ChangeTracker.OriginalValues.ContainsKey("DispatchRegion")
                 && (ChangeTracker.OriginalValues["DispatchRegion"] == DispatchRegion))
             {
                 ChangeTracker.OriginalValues.Remove("DispatchRegion");
             }
             else
             {
                 ChangeTracker.RecordOriginalValue("DispatchRegion", previousValue);
             }
             if (DispatchRegion != null && !DispatchRegion.ChangeTracker.ChangeTrackingEnabled)
             {
                 DispatchRegion.StartTracking();
             }
         }
     }
Esempio n. 2
0
     public bool Equals(DispatchRegion other)
     {
         if (ReferenceEquals(null, other)) return false;
         if (ReferenceEquals(this, other)) return true;
 		if (other.Id == 0 && Id == 0)
 			return false;
 		else
 			return other.Id == Id;
     }