Пример #1
0
        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 (".");
            }
        }
Пример #2
0
 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;
 }
Пример #3
0
 public bool PrepareForDrag(DragDestination sender)
 {
     if (ValidateDrag (sender) != null)
         return true;
     return false;
 }
Пример #4
0
 public bool PerformDrag(DragDestination sender)
 {
     if (ValidateDrag (sender) != null)
         return true;
     return false;
 }
Пример #5
0
 public int DraggingUpdated(DragDestination sender)
 {
     if (ValidateDrag (sender) != null)
         return (int)DragOperation.Copy;
     return (int)DragOperation.None;
 }
Пример #6
0
 public void DraggingExited(DragDestination sender)
 {
     // nop
 }