Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Access source data during drag-drop.

 
Subscribe to the RSS feed for this forum  Forum Index -> EZNamespaceExtensions.Net
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Fri Jan 16, 2009 6:14 am    Post subject: HOWTO: Access source data during drag-drop.

When a drag-drop operation takes place, the DragEnter, DragOver and DragDrop methods of NSEItem are called. The Data property of the NSEDragEventArgs instance passed to each of these methods contain information about the data that is being drag-dropped.

For example, if files/folders from the filesystem (such as the c:\ drive) are being drag-dropped, you can access them using :
[C#]
Code:
string []paths = e.Data.GetData(DataFormats.FileDrop);

[VB.Net]
Code:
Dim paths() As String = e.Data.GetData(DataFormats.FileDrop)

Another common way for sources to present data is via streams. For example, when emails are dragged from Outlook, Outlook makes those emails available via streams. Your namespace extension can access this data using the NSEDataObject.GetFileDesriptors and NSEDataObject.GetFileContent methods. See the documentation of these methods for more information.

If the source of the drag-drop is your own namespace extension, you can use your own format to identify the items. See the RegistryBrowser sample which utilities this method. It stores the full path of dragged keys/values in its own format. This data can then be retrieved in the DragEnter, DragOver and DragDrop methods.
Back to top
Display posts from previous:   
Forum Index -> EZNamespaceExtensions.Net All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group