Created
May 18, 2016 18:35
-
-
Save anonymous/d921a5190c9434b84b86d77dd16f883b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void grid_liste_piecejointe_DragEnter(object sender, DragEventArgs e) | |
{ | |
if (e.Data.GetDataPresent(DataFormats.FileDrop)) | |
e.Effect = DragDropEffects.Move; | |
else | |
e.Effect = DragDropEffects.None; | |
} | |
private void grid_liste_piecejointe_DragDrop(object sender, DragEventArgs e) { | |
var dropped = ((string[])e.Data.GetData(DataFormats.FileDrop)); | |
var files = dropped.ToList(); | |
if (!files.Any()) | |
return; | |
foreach (string drop in dropped) | |
if (Directory.Exists(drop)) | |
files.AddRange(Directory.GetFiles(drop, filterFile, SearchOption.AllDirectories)); | |
foreach (string file in files) | |
{ | |
if (!checkAttachmentExists(file) && checkExtensionFile(file)) | |
{ | |
PieceJointe pj = new PieceJointe(); | |
pj.setPiecejointe(file); | |
list_pj.Add(pj); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment