You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Creates a copy of the provided file within this folder.
14
+
/// </summary>
15
+
/// <param name="destinationFolder">The folder where the copy is created.</param>
16
+
/// <param name="fileToCopy">The file to be copied into this folder.</param>
17
+
/// <param name="overwrite"><code>true</code> if any existing destination file can be overwritten; otherwise, <c>false</c>.</param>
18
+
/// <param name="cancellationToken">A token that can be used to cancel the ongoing operation.</param>
19
+
/// <exception cref="FileAlreadyExistsException">Thrown when <paramref name="overwrite"/> is false and the resource being created already exists.</exception>
/// Creates a copy of the provided file within this folder.
35
+
/// </summary>
36
+
/// <param name="destinationFolder">The folder where the copy is created.</param>
37
+
/// <param name="fileToCopy">The file to be copied into this folder.</param>
38
+
/// <param name="newName">The name to use for the created file.</param>
39
+
/// <param name="overwrite"><code>true</code> if any existing destination file can be overwritten; otherwise, <c>false</c>.</param>
40
+
/// <param name="cancellationToken">A token that can be used to cancel the ongoing operation.</param>
41
+
/// <exception cref="FileAlreadyExistsException">Thrown when <paramref name="overwrite"/> is false and the resource being created already exists.</exception>
Copy file name to clipboardExpand all lines: src/Extensions/ICreateCopyOf.cs
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
namespaceOwlCore.Storage;
6
6
7
7
/// <summary>
8
-
/// Provides a way for implementations to override behavior of the <see cref="ModifiableFolderExtensions.CreateCopyOfAsync"/> extension method.
8
+
/// Provides a way for implementations to override behavior of the <see cref="ModifiableFolderExtensions.CreateCopyOfAsync(IModifiableFolder, IFile, bool, CancellationToken)"/> extension method.
9
9
/// </summary>
10
10
/// <exception cref="FileNotFoundException">The item was not found in the provided folder.</exception>
11
11
publicinterfaceICreateCopyOf:IModifiableFolder
@@ -26,3 +26,26 @@ public interface ICreateCopyOf : IModifiableFolder
/// Provides a way for implementations to override behavior of the <see cref="ModifiableFolderExtensions.CreateCopyOfAsync(IModifiableFolder, IFile, bool, string, CancellationToken)"/> extension method.
32
+
/// </summary>
33
+
publicinterfaceICreateRenamedCopyOf:ICreateCopyOf
34
+
{
35
+
/// <summary>
36
+
/// Creates a copy of the provided file within this folder.
37
+
/// </summary>
38
+
/// <param name="fileToCopy">The file to be copied into this folder.</param>
39
+
/// <param name="overwrite">If there is an existing destination file, <c>true</c> will overwrite it; otherwise <c>false</c> and the existing file is opened.</param>
40
+
/// <param name="newName">The new name of the created file.</param>
41
+
/// <param name="cancellationToken">A token that can be used to cancel the ongoing operation.</param>
42
+
/// <param name="fallback">The fallback to use if the provided <paramref name="fileToCopy"/> isn't supported.</param>
43
+
/// <returns>The newly created (or opened if existing) file.</returns>
Copy file name to clipboardExpand all lines: src/Extensions/IMoveFrom.cs
+30-4Lines changed: 30 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,11 @@
1
-
usingSystem;
2
-
usingSystem.IO;
1
+
usingSystem.IO;
3
2
usingSystem.Threading;
4
3
usingSystem.Threading.Tasks;
5
4
6
5
namespaceOwlCore.Storage;
7
6
8
7
/// <summary>
9
-
/// Provides a fast-path for the <see cref="ModifiableFolderExtensions.MoveFromAsync"/> extension method.
8
+
/// Provides a fast-path for the <see cref="ModifiableFolderExtensions.CreateCopyOfAsync(IModifiableFolder, IFile, bool, CancellationToken)"/> extension method.
10
9
/// </summary>
11
10
/// <exception cref="FileNotFoundException">The item was not found in the provided folder.</exception>
12
11
publicinterfaceIMoveFrom:IModifiableFolder
@@ -26,4 +25,31 @@ public interface IMoveFrom : IModifiableFolder
26
25
/// <summary>
27
26
/// A delegate that provides a fallback for the <see cref="IMoveFrom.MoveFromAsync"/> method.
/// Provides a fast-path for the <see cref="ModifiableFolderExtensions.CreateCopyOfAsync(IModifiableFolder, IFile, bool, string, CancellationToken)"/> extension method.
32
+
/// </summary>
33
+
/// <remarks>
34
+
/// This interface derives from <see cref="IMoveFrom"/> to enforce non-fallback compatibility with the non-rename overload.
35
+
/// </remarks>
36
+
/// <exception cref="FileNotFoundException">The item was not found in the provided folder.</exception>
37
+
publicinterfaceIMoveRenamedFrom:IMoveFrom
38
+
{
39
+
/// <summary>
40
+
/// Moves a storable item out of the provided folder, and into this folder. Returns the new item that resides in this folder.
41
+
/// </summary>
42
+
/// <param name="fileToMove">The file being moved into this folder.</param>
43
+
/// <param name="source">The folder that <paramref name="fileToMove"/> is being moved from.</param>
44
+
/// <param name="overwrite">If there is an existing destination file, <c>true</c> will overwrite it; otherwise <c>false</c> and the existing file is opened.</param>
45
+
/// <param name="newName">The new name of the created file.</param>
46
+
/// <param name="cancellationToken">A token that can be used to cancel the ongoing operation.</param>
47
+
/// <param name="fallback">The fallback to use if the provided <paramref name="fileToMove"/> isn't supported.</param>
48
+
/// <returns>The newly created (or opened if existing) file.</returns>
0 commit comments