Sky Software Homepage LogicNP Software Knowledge Base And FAQ

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

HOWTO: Retrieve selected items in Windows Explorer or a File Open/Save dialog

 
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: Tue Aug 26, 2008 6:03 am    Post subject: HOWTO: Retrieve selected items in Windows Explorer or a File Open/Save dialog

Use the GetSelectedItems method in the OnSelectionChanged method to retrieve the list of selected items in Windows Explorer or a File Open/Save dialog.

This can be used in combination with the OnCommonDialogOKButtonClicked method to determine the item(s) selected in the File Open/Save dialog when the 'OK' button is clicked (or when item is double-clicked or when item is selected and 'Enter' is pressed) :

[C#]
class MyNSEFolder : NSEFolder
{
...
...

NSEItem[] selectedItems = null;
public override void OnSelectionChanged()
{
selectedItems = this.GetSelectedItems(); // Store selected items
}

public override void OnCommonDialogOKButtonClicked(CommonDialogOKButtonClickedEventArgs e)
{
// 'selectedItems' array now contains user-selected item(s)
foreach (NSEItem item in selectedItems)
{
System.Diagnostics.Debug.WriteLine(item.ToString());
}
}

...
...

}


[VB.Net]
Public Class MyNSEFolder
Inherits NSEFolder
...
...

Dim selectedItems As NSEItem() = Nothing

Public Overrides Sub OnSelectionChanged()
selectedItems = Me.GetSelectedItems() ' Store selected items
End Sub

Public Overrides Sub OnCommonDialogOKButtonClicked(ByVal e As CommonDialogOKButtonClickedEventArgs)
'selectedItems array now contains user-selected item(s)
Dim item As NSEItem
For Each item In selectedItems
System.Diagnostics.Debug.WriteLine(item.ToString())
Next
End Sub

...
...

End Class
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