From 4b8c27c4d27e6990d563b2ec44545584c9550a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sk=C3=A1la?= Date: Thu, 16 Mar 2017 20:03:36 +0100 Subject: [PATCH 1/4] Convention way of access specification. --- DriversBackup/Models/DriverInformation.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } From 6149e394cdf72e16759024729f7ee8d71da56054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sk=C3=A1la?= Date: Thu, 16 Mar 2017 20:15:32 +0100 Subject: [PATCH 2/4] Correct documentation missinterpretation. --- DriversBackup/Models/General.INIFiles.cs | Bin 3834 -> 4374 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/DriversBackup/Models/General.INIFiles.cs b/DriversBackup/Models/General.INIFiles.cs index 9fcc483ad6d2a22f3b3ce04f7a77bdbb30fa68e4..9586f8b41914e28d8bd1a4645c946b909240c470 100644 GIT binary patch delta 772 zcmcIhJxjw-6uk-kAWd7OAQZ70D?%fR;NsM&g(4z2>y$Q)t+tJ=Nu}cGEXoD(AGj(7 zN5OyM>ZGF-2hV#UwW5v^NM6o4@7#0m9p$d`cLxf0lylvnA{pdSk9@w0Ebxq)j!KM8 zwfKX*Q1byhyjOkIs!$zQ4Qf({9CBgOCJRUt=ML}!**Mq6hy}%fOfZMIIiO>l9AGZ) zg)RbVQVTp-?yA%L7D@0!bT_ply&F(^?p3}2@sVA)RFGCGS8sx4apQu)q30-_W zAi`NB4(1T_BJ;>aw844Qz!YrMtnjlwTPg!{a8pc7EPAr<0vNG!1DYP5;M|avZRka{ ueKO&-#>>g6#ZCM>P>1XNN<4ODJ-#tKN{$ph)w2Jv+^(AAcP+y=>FOu-d!>p1 delta 234 zcmbQH^hdH^IoP>CQ(O*WFSmsC0Gp0z(c%CPNZK5kn#nR{~`d8S)rXz%)z`TnA9R2&lRYsJjTLA{$6o zG89if$RM|HH=m4?i$q8H?lc%s& tOg7?io7})A0;B`LY%N}y$(z{hHoxIDV4D1bMFgl&YVtF7k;x|n`~dQ5IvM}~ From 7a5ddf56664cf6dc67850f421f01912e36fc39f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sk=C3=A1la?= Date: Thu, 16 Mar 2017 20:25:53 +0100 Subject: [PATCH 3/4] Fix file naming --- DriversBackup/DriversBackup.csproj | 2 +- .../{General.INIFiles.cs => INIFiles.cs} | Bin 4374 -> 4770 bytes 2 files changed, 1 insertion(+), 1 deletion(-) rename DriversBackup/Models/{General.INIFiles.cs => INIFiles.cs} (90%) 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/General.INIFiles.cs b/DriversBackup/Models/INIFiles.cs similarity index 90% rename from DriversBackup/Models/General.INIFiles.cs rename to DriversBackup/Models/INIFiles.cs index 9586f8b41914e28d8bd1a4645c946b909240c470..5f0b1db7b5582f3df2e55e9b937aef9869755b98 100644 GIT binary patch delta 182 qcmbQHv`BSB2$}ihal Date: Sat, 18 Mar 2017 18:00:11 +0100 Subject: [PATCH 4/4] Edit documentation --- DriversBackup/Models/DriverBackup.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) 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; }