Ejemplo n.º 1
0
 /// <summary>
 /// Raises the <see cref="FolderChanging"/> to stop navigation to a particular location.
 /// </summary>
 /// <param name="e">Cancelable event arguments.</param>
 protected virtual void OnFolderChanging(CommonFileDialogFolderChangeEventArgs e)
 {
     EventHandler<CommonFileDialogFolderChangeEventArgs> handler = FolderChanging;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Ejemplo n.º 2
0
            public HResult OnFolderChanging(IFileDialog pfd, IShellItem psiFolder)
            {
                CommonFileDialogFolderChangeEventArgs args = new CommonFileDialogFolderChangeEventArgs(
                    CommonFileDialog.GetFileNameFromShellItem(psiFolder));

                if (!firstFolderChanged) { parent.OnFolderChanging(args); }

                return (args.Cancel ? HResult.False : HResult.Ok);
            }
            public HResult OnFolderChanging(IFileDialog pfd, IShellItem psiFolder)
            {
                CommonFileDialogFolderChangeEventArgs args = new CommonFileDialogFolderChangeEventArgs(
                    CommonFileDialog.GetFileNameFromShellItem(psiFolder));

                if (!firstFolderChanged) { parent.OnFolderChanging(args); }

                return (args.Cancel ? HResult.False : HResult.Ok);
            }
 /// <summary>
 /// Raises the <see cref="FolderChanging"/> to stop navigation to a particular location.
 /// </summary>
 /// <param name="e">Cancelable event arguments.</param>
 protected virtual void OnFolderChanging(CommonFileDialogFolderChangeEventArgs e)
 {
     EventHandler<CommonFileDialogFolderChangeEventArgs> handler = FolderChanging;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Ejemplo n.º 5
0
 public HRESULT OnFolderChanging(IFileDialog pfd, IShellItem psiFolder)
 {
     CommonFileDialogFolderChangeEventArgs args =
         new CommonFileDialogFolderChangeEventArgs(CommonFileDialog.GetFileNameFromShellItem(psiFolder));
     if (!firstFolderChanged)
         parent.OnFolderChanging(args);
     return (args.Cancel ? HRESULT.S_FALSE : HRESULT.S_OK);
 }
 private void FolderSelectionDialog_FolderChanging(object sender, CommonFileDialogFolderChangeEventArgs e)
 {
     // require folders to be loaded be either the same folder as the .tdb and .ddb or subfolders of it
     if ((e.Folder == null) || (e.Folder.StartsWith(this.FolderPath, StringComparison.OrdinalIgnoreCase) == false))
     {
         // rather than cancel the event, override the selected path
         // This produces a better experience in cases where the user selects a folder that's above the databases as there's a visible response
         // when the current folder is a subfolder.
         e.Folder = this.FolderPath;
     }
 }