void OnTreeViewDragDataGet (object sender, Gtk.DragDataGetArgs args)
{
List<Note> selected_notes = GetSelectedNotes ();
if (selected_notes == null || selected_notes.Count == 0)
return;
string uris = string.Empty;
string paths = string.Empty;
foreach (Note note in selected_notes) {
uris += note.Uri + "\r\n";
paths += "file://" + note.FilePath + "\r\n";
}
if(args.Info == (uint) Target.Path)
args.SelectionData.Set (Gdk.Atom.Intern ("text/path-list", false),
8,
Encoding.UTF8.GetBytes (paths));
else
args.SelectionData.Set (Gdk.Atom.Intern ("text/uri-list", false),
8,
Encoding.UTF8.GetBytes (uris));
if (selected_notes.Count == 1)
args.SelectionData.Text = selected_notes [0].Title;
else
args.SelectionData.Text = Catalog.GetString ("Notes");
}