Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Fri Aug 10, 2007 4:00 am Post subject: HOWTO : Capture the open and save event in a File Open/Save dialog. |
|
|
Note : To display your namespace extension in file Open/Save dialogs, see http://www.ssware.com/support/viewtopic.php?p=355
Whenever the Open or Save button of a File Open/Save dialog is clicked, the OnCommonDialogOKButtonClicked method of NSEFolder is called. You must override this method and synchronize your data source with the file system. You can use the HostType property of NSEFolder to determine whether your namespace extension is being viewed in a Open dialog or a Save dialog.
In case of an Open dialog, your OnCommonDialogOKButtonClicked method must bring the data corresponding to the item that was selected in the Open dialog to the file system location to which the namespace extension item maps (The mapped location is returned from the GetDisplayNameEx method when the parameter is DisplayNameFlags.ForParsing).
In case of a Save dialog, you have to use a background process to monitor the contents of the mapped location. When a file is created/deleted or modified in the mapped location ( or its sub-folder), you must synchronize your source (database/FTP location/etc) with the changes. A background process is required for this because the file is saved directly by the application - Windows does not have any way of exposing the saved data to the namespace extension. Using a background watcher process is the only to monitor when files are created/deleted or modified. |
|