mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Code style - Use file scoped namespaces
Code style - Ran code cleanup
This commit is contained in:
1 parent
e68e16df4d
commit
f6090dc296
691 files changed
+37301
-38119
No files matched your search
@@ -2,43 +2,42 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Artemis.Core
|
||||
namespace Artemis.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a plugin prerequisite action that deletes a file
|
||||
/// </summary>
|
||||
public class DeleteFileAction : PluginPrerequisiteAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a plugin prerequisite action that deletes a file
|
||||
/// Creates a new instance of a copy folder action
|
||||
/// </summary>
|
||||
public class DeleteFileAction : PluginPrerequisiteAction
|
||||
/// <param name="name">The name of the action</param>
|
||||
/// <param name="target">The target folder to delete recursively</param>
|
||||
public DeleteFileAction(string name, string target) : base(name)
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of a copy folder action
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the action</param>
|
||||
/// <param name="target">The target folder to delete recursively</param>
|
||||
public DeleteFileAction(string name, string target) : base(name)
|
||||
Target = target;
|
||||
ProgressIndeterminate = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the target directory
|
||||
/// </summary>
|
||||
public string Target { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async Task Execute(CancellationToken cancellationToken)
|
||||
{
|
||||
ShowProgressBar = true;
|
||||
Status = $"Removing {Target}";
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
Target = target;
|
||||
ProgressIndeterminate = true;
|
||||
}
|
||||
if (File.Exists(Target))
|
||||
File.Delete(Target);
|
||||
}, cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the target directory
|
||||
/// </summary>
|
||||
public string Target { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override async Task Execute(CancellationToken cancellationToken)
|
||||
{
|
||||
ShowProgressBar = true;
|
||||
Status = $"Removing {Target}";
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
if (File.Exists(Target))
|
||||
File.Delete(Target);
|
||||
}, cancellationToken);
|
||||
|
||||
ShowProgressBar = false;
|
||||
Status = $"Removed {Target}";
|
||||
}
|
||||
ShowProgressBar = false;
|
||||
Status = $"Removed {Target}";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user