GDStorageFolderRenameAsync Method (String) |
Namespace: GD
public IAsyncAction RenameAsync( string desiredName )
Exception | Condition | ||||||
---|---|---|---|---|---|---|---|
Exception |
Name you specify is invalid. To handle all the ways the specified name could be invalid, you must catch all of these exceptions:
| ||||||
AccessDeniedException | (C# equivalent: System.UnauthorizedAccessException) Secure storage was remotely wiped. | ||||||
InvalidArgumentException | (C# equivalent: System.ArgumentException) The name contains invalid characters, or the format of the path is incorrect. Check the value of desiredName. |
This method doesn't allow existing directory to be moved to different location.
This method uses the FailIfExists value from the NameCollisionOption enumeration by default. That is, this method raises an exception if a folder with the desiredName already exists. If you want to handle a folder name collision in a different way, call the RenameAsync(String, NameCollisionOption) method.
If the file is deleted before the rename finishes, this method throws the ERROR_FILE_NOT_FOUND exception. You must also catch and handle this exception when you use this method.