Exemple #1
0
        private static void ParkObstacle(SnapObstacle avoider, SnapDescription snapDescription)
        {
            avoider.VerifyAccess();
            PointInt32 location  = avoider.Bounds.Location;
            PointInt32 num2      = AdjustNewLocation(avoider, location, snapDescription);
            RectInt32  newBounds = new RectInt32(num2, avoider.Bounds.Size);

            avoider.RequestBoundsChange(newBounds);
        }
Exemple #2
0
 private void LoadSnapObstacleData(SnapObstacle so)
 {
     if (so.PersistenceHandler.IsDataAvailable)
     {
         SnapDescription description;
         if (!so.PersistenceHandler.IsSnapped)
         {
             description = null;
         }
         else
         {
             string snappedToName = so.PersistenceHandler.SnappedToName;
             description = new SnapDescription(this.FindObstacle(snappedToName), so.PersistenceHandler.HorizontalEdge, so.PersistenceHandler.VerticalEdge, so.PersistenceHandler.Offset);
         }
         this.obstacles[so] = description;
         RectInt32 bounds = so.PersistenceHandler.Bounds;
         so.RequestBoundsChange(bounds);
         if (description != null)
         {
             ParkObstacle(so, description);
         }
     }
 }