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 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(".");
            }
        }
Esempio n. 3
0
 public void CopyToClipboard(string text)
 {
     Pasteboard.DeclareTypes(pasteboardTypes, null);
     Pasteboard.ClearContents();
     Pasteboard.SetStringForType(text, pasteboardType);
 }