Click or drag to resize
GDStorageFileRenameAsync Method (String)
Renames the current file.

Namespace:  GD
Assembly:  GD (in GD.dll) Version: 255.255.255.255
Syntax
public IAsyncAction RenameAsync(
	string desiredName
)

Parameters

desiredName
Type: SystemString
The desired, new name of the current item.

Return Value

Type: IAsyncAction
No object or value is returned by this method when it completes.

Implements

IGDStorageItemRenameAsync(String)
IGDStorageItemRenameAsync(String)
Exceptions
ExceptionCondition
Exception Name you specify is invalid. To handle all the ways the specified name could be invalid, you must catch all of these exceptions:
E_FAIL
ERROR_ALREADY_EXISTS
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.
Remarks
This method uses the FailIfExists value from the NameCollisionOption enumeration by default. That is, this method raises an exception if a file with the same name already exists. If you want to handle a file name collision in a different way, call the RenameAsync(String, NameCollisionOption) method.
See Also