public void StartDrag(FloatingWindow wnd, Point point, Point offset) { Offset = offset; _wnd = wnd; if (Offset.X >= _wnd.Width) Offset.X = _wnd.Width / 2; _wnd.Left = point.X - Offset.X; _wnd.Top = point.Y - Offset.Y; _wnd.Show(); int surfaceCount = 0; restart: surfaceCount = Surfaces.Count; foreach (IDropSurface surface in Surfaces) { if (surface.SurfaceRectangle.Contains(point)) { SurfacesWithDragOver.Add(surface); surface.OnDragEnter(point); Debug.WriteLine("Enter " + surface.ToString()); if (surfaceCount != Surfaces.Count) { //Surfaces list has been changed restart cycle SurfacesWithDragOver.Clear(); goto restart; } } } }
public void StartDrag(FloatingWindow wnd, Point point, Point offset) { Debug.Assert(!IsDragging); IsDragging = true; Offset = offset; _wnd = wnd; if (Offset.X >= _wnd.Width) { var ox = _wnd.Width / 2; Offset = new Point(ox, Offset.Y); } _wnd.Position = new Point(point.X - Offset.X, point.Y - Offset.Y); _wnd.Show(); int surfaceCount = 0; restart: surfaceCount = Surfaces.Count; foreach (IDropSurface surface in Surfaces) { if (surface.SurfaceRectangle.Contains(point)) { SurfacesWithDragOver.Add(surface); surface.OnDragEnter(point); Debug.WriteLine("Enter " + surface.ToString()); if (surfaceCount != Surfaces.Count) { //Surfaces list has been changed restart cycle SurfacesWithDragOver.Clear(); goto restart; } } } }
public void StartDrag(FloatingWindow wnd, Point point, Point offset) { Debug.Assert(!IsDragging); IsDragging = true; Offset = offset; _wnd = wnd; if (Offset.X >= _wnd.Width) { Offset.X = _wnd.Width / 2; } _wnd.Left = point.X - Offset.X; _wnd.Top = point.Y - Offset.Y; _wnd.Show(); var surfaceCount = 0; restart: surfaceCount = Surfaces.Count; foreach (var surface in Surfaces) { if (surface.SurfaceRectangle.Contains(point)) { SurfacesWithDragOver.Add(surface); surface.OnDragEnter(point); Debug.WriteLine("Enter " + surface); if (surfaceCount != Surfaces.Count) { //Surfaces list has been changed restart cycle SurfacesWithDragOver.Clear(); goto restart; } } } }