You can add a ‘Create Folder’ command for the SelectEntity dialog, using the CreateFolder property in the SelectEntitySettings.SelectEntityOptionsExtensibility Class. If this property is not set then the ‘Create Folder’ button is not shown at all.
Once this property is set, you should be able to see the ‘Create Folder’ button as shown below.
Below is the code sample for reference. The easiest way to test the below code would be to add it in the VaultList sample that comes along with the Vault SDK.
try
{
VDF.Vault.Forms.Settings.SelectEntitySettings settings = new VDF.Vault.Forms.Settings.SelectEntitySettings();
settings.OptionsExtensibility.CreateFolder = createFolder;VDF.Vault.Forms.Results.SelectEntityResults selresults = VDF.Vault.Forms.Library.SelectEntity (connection, settings);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error");
}
VDF.Vault.Library.ConnectionManager.LogOut(connection);
VDF.Vault.Currency.Entities.IEntity createFolder(VDF.Vault.Currency.Entities.IEntity dir)
{
VDF.Vault.Currency.Entities.Folder parentfolder = dir as VDF.Vault.Currency.Entities.Folder;
VDF.Vault.Currency.Entities.Folder createdfolder = connection.FolderManager.CreateFolder(parentfolder, "Demo_folder", false, EntityCategory.EmptyCategory);
return createdfolder;
}
When the 'Create folder' button is pressed, you would find that the new folder has been created in the current location.