public void ConcludeDrag(DragDestination sender) { string type = ValidateDrag (sender); if (type != null) { Pasteboard pb = sender.Pasteboard; string [] list = pb.ListForType (type); filename.Value = list [0]; FileWrapper file = new FileWrapper (list [0]); iconwell.Image = file.Icon; } else { Console.WriteLine ("."); } }
private string ValidateDrag(DragDestination sender) { Console.WriteLine ("validatedrag"); if (sender.Source != this) { Pasteboard pb = sender.Pasteboard; if (pb.Types.Length > 0) { foreach (string type in pb.Types) { if (type.Equals (Pasteboard.Filenames)) { return type; } } } } return null; }
public bool PrepareForDrag(DragDestination sender) { if (ValidateDrag (sender) != null) return true; return false; }
public bool PerformDrag(DragDestination sender) { if (ValidateDrag (sender) != null) return true; return false; }
public int DraggingUpdated(DragDestination sender) { if (ValidateDrag (sender) != null) return (int)DragOperation.Copy; return (int)DragOperation.None; }
public void DraggingExited(DragDestination sender) { // nop }