|
|
To update Explorer's views you must to use the following
methods of DataProvider component:
- NotifyAddGrain - used to notify about just created
DataGrains
- NotifyDeleteGrain - used to notify about deleted
DataGrains
- NotifyRenameGrain - used to notify about renamed
DataGrains
- NotifyUpdateGrain - used to notify about modified
DataGrains
Also the property ChangeNotifyType of ShellView
component used to specify how the update should be performed. If
its ChangeNotifyType=cntLocal it should use internal method
of notifications, if ChangeNotifyType=cntGlobal it should
use system-defined way to send notifications. In this case your
NSE may be locked by Windows caching system and you will need to
restart Windows
Shell.
|
|
Shell+ handles dropping of folders and subfolders automatically.
It parses incoming shell data and raises appropriate DataProvider
events: OnCreateNewFolder, OnNewGrainFromFileEx or OnNewGrainFromStreamEx.
The last two events are interchangeable (OnNewGrainFromStreamEx
event was introduced to support drag&drop from Outlook). So, to
support dropping folders on your NSE you just need to handle OnCreateNewFolder
event.
In the OnCreateNewFolder event handler you should
create folder object in your data storage and return the DataGrain
which initialized with the data from newly created folder. Here
is an example:
procedure TPermanentModule.DataProviderCreateNewFolder(
Sender: TSxCustomProvider; OwnerFolderGrain: TSxCustomDataGrain;
NewFolderName: WideString; out NewFolderGrain: TSxCustomDataGrain);
var
tempFileStg:IMDFileObj;
tempNewStg:IMDFileObj;
begin
MDServer.GetRelativeFileStorage(OwnerFolderGrain.Strings.Values[vGrainPath],tempFileStg);
if tempFileStg=nil then
Exit;
tempFileStg.AddNewChild(NewFolderName,tempNewStg);
NewFolderGrain:=CreateGrainFromStg(tempNewStg,OwnerFolderGrain);
end;
|
|
|