diff --git a/DriversBackup/DriversBackup.csproj b/DriversBackup/DriversBackup.csproj index bc0a362..fccf337 100644 --- a/DriversBackup/DriversBackup.csproj +++ b/DriversBackup/DriversBackup.csproj @@ -154,7 +154,7 @@ - + Code diff --git a/DriversBackup/Models/DriverBackup.cs b/DriversBackup/Models/DriverBackup.cs index a799562..89dc6eb 100644 --- a/DriversBackup/Models/DriverBackup.cs +++ b/DriversBackup/Models/DriverBackup.cs @@ -24,7 +24,7 @@ public DriverBackup() /// /// Returns a list of drivers registered on a system. /// - /// ArrayList containing driver information + /// yList containing driver information public List ListDrivers(bool showMicrosoft = false) { var driverList = new List(); @@ -56,8 +56,7 @@ public List ListDrivers(bool showMicrosoft = false) try { - // Add information to our ArrayList. - + // Add information to result List. tmpDesc = regDriver.GetValue("DriverDesc").ToString(); tmpProvider = regDriver.GetValue("ProviderName").ToString(); } @@ -70,20 +69,19 @@ public List ListDrivers(bool showMicrosoft = false) if (tmpProvider.Length > 0 && tmpDesc.Length > 0) { + // add non microsoft driver if (tmpProvider != "Microsoft") { driverList.Add( new DriverInformation(tmpProvider, tmpDesc, deviceGuid, regDriverNumber) ); } - else + //if microsoft drivers ae required, add them too + else if (showMicrosoft) { - if (showMicrosoft) - { - driverList.Add( - new DriverInformation(tmpProvider, tmpDesc, deviceGuid, regDriverNumber) - ); - } + driverList.Add( + new DriverInformation(tmpProvider, tmpDesc, deviceGuid, regDriverNumber) + ); } } @@ -98,8 +96,8 @@ public List ListDrivers(bool showMicrosoft = false) } } + // free resources regDeviceGuiDs.Close(); - return driverList; } diff --git a/DriversBackup/Models/DriverInformation.cs b/DriversBackup/Models/DriverInformation.cs index f6a4e04..a3bb76f 100644 --- a/DriversBackup/Models/DriverInformation.cs +++ b/DriversBackup/Models/DriverInformation.cs @@ -5,7 +5,7 @@ namespace DriversBackup.Models /// /// Object setup for binding to our ArrayList. /// - public class DriverInformation:ViewModelBase + public class DriverInformation : ViewModelBase { private bool isSelected; @@ -16,10 +16,10 @@ public DriverInformation(string driverProvider, string driverDescription, string DriverDeviceGuid = driverDeviceGuid; DriverId = driverId; } - public string DriverProvider { get; } - public string DriverDescription { get; } - public string DriverDeviceGuid { get; } - public string DriverId { get; } + public string DriverProvider { get; private set; } + public string DriverDescription { get; private set; } + public string DriverDeviceGuid { get; private set; } + public string DriverId { get; private set; } public bool IsSelected { get { return isSelected; } diff --git a/DriversBackup/Models/General.INIFiles.cs b/DriversBackup/Models/INIFiles.cs similarity index 61% rename from DriversBackup/Models/General.INIFiles.cs rename to DriversBackup/Models/INIFiles.cs index 9fcc483..5f0b1db 100644 Binary files a/DriversBackup/Models/General.INIFiles.cs and b/DriversBackup/Models/INIFiles.cs differ