Skip to content

Commit

Permalink
Driver function annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
JusterZhu committed Nov 19, 2023
1 parent 2fd18bb commit ee2ea7f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/c#/GeneralUpdate.Core/Driver/BackupDriverCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public BackupDriverCommand(DriverInformation information)

public void Execute()
{
/*
* Back up the specified list of drives.
*/
foreach (var driverName in _information.DriverNames)
{
var command = new StringBuilder("/c dism /online /export-driver /destination:\"")
Expand Down
6 changes: 6 additions & 0 deletions src/c#/GeneralUpdate.Core/Driver/DriverProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace GeneralUpdate.Core.Driver
{
/// <summary>
/// Handle all drive-related.
/// </summary>
public class DriverProcessor
{
private List<IDriverCommand> _commands = new List<IDriverCommand>();
Expand All @@ -11,6 +14,9 @@ public void AddCommand(IDriverCommand command)
_commands.Add(command);
}

/// <summary>
/// Execute all driver-related commands.
/// </summary>
public void ProcessCommands()
{
foreach (var command in _commands)
Expand Down
1 change: 1 addition & 0 deletions src/c#/GeneralUpdate.Core/Driver/InstallDriverCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public void Execute()
{
try
{
//Install all drivers in the specified directory, and if the installation fails, restore all the drivers in the backup directory.
var command = new StringBuilder("/c pnputil /add-driver \"")
.Append(_information.InstallDirectory)
.Append("\"")
Expand Down
1 change: 1 addition & 0 deletions src/c#/GeneralUpdate.Core/Driver/RestoreDriverCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public RestoreDriverCommand(DriverInformation information)

public void Execute()
{
//Restore all drives in the backup directory.
var command = new StringBuilder("/c pnputil /add-driver \"")
.Append(_information.OutPutDirectory)
.Append("\"")
Expand Down

0 comments on commit ee2ea7f

Please sign in to comment.