private void transPanel_DragOver(object sender, DragEventArgs de) { if (m_draggingItem) { Point clientPoint = CurrentEditor.PointToClient(new Point(de.X, de.Y)); int pos = CurrentEditor.PositionFromPoint(clientPoint.X, clientPoint.Y); if (CurrentEditor.DropMarkers.MarkerStack.Count > 0) { DropMarker dm = CurrentEditor.DropMarkers.MarkerStack.Peek(); dm.Change(pos, pos); } } }
public void EndDrag() { m_draggingItem = false; m_transPanel.SendToBack(); if (CurrentEditor.DropMarkers.MarkerStack.Count > 0) { DropMarker dm = CurrentEditor.DropMarkers.MarkerStack.Pop(); try { dm.Collect(); } catch (NullReferenceException nre) { Console.WriteLine(nre.ToString()); } } }
private void transPanel_DragDrop(object sender, DragEventArgs de) { if (m_draggingItem) { DataFormats.Format format = DataFormats.GetFormat("ChameleonSnippet"); string snippetName = (string)de.Data.GetData(format.Name); Point clientPoint = CurrentEditor.PointToClient(new Point(de.X, de.Y)); int pos = CurrentEditor.PositionFromPoint(clientPoint.X, clientPoint.Y); DropMarker dm = CurrentEditor.DropMarkers.MarkerStack.Peek(); dm.Collect(); m_transPanel.SendToBack(); CurrentEditor.Focus(); CurrentEditor.Snippets.InsertSnippet(snippetName); } }
private void transPanel_DragEnter(object sender, DragEventArgs de) { if (m_draggingItem && m_dragInitialized) { return; } DataFormats.Format format = DataFormats.GetFormat("ChameleonSnippet"); if (de.Data.GetDataPresent(format.Name)) { de.Effect = DragDropEffects.Copy; Point clientPoint = CurrentEditor.PointToClient(new Point(de.X, de.Y)); int pos = CurrentEditor.PositionFromPoint(clientPoint.X, clientPoint.Y); DropMarker dm = CurrentEditor.DropMarkers.Drop(pos); } else { de.Effect = DragDropEffects.None; } m_dragInitialized = true; }
/// <summary> /// Initializes a new instance of the DropMarkerCollectEventArgs class. /// </summary> /// <param name="dropMarker"></param> public DropMarkerCollectEventArgs(DropMarker dropMarker) { _dropMarker = dropMarker; }