removed public getter methods, using properties instead

This commit is contained in:
HorizonCode 2021-05-27 06:08:55 +02:00
parent 2042a829da
commit a4f060debe
2 changed files with 10 additions and 20 deletions

View File

@ -55,28 +55,28 @@ namespace EZPPClient_Installer
MessageBox.Show("Folder does not exist: " + pathToEZPP); MessageBox.Show("Folder does not exist: " + pathToEZPP);
#endif #endif
foreach (MD5File md5File in md5Files) foreach (MD5File md5File in md5Files)
downloadList.Add(md5File.getName()); downloadList.Add(md5File.Name);
} }
else else
{ {
foreach (MD5File md5file in md5Files) foreach (MD5File md5file in md5Files)
{ {
string file = pathToEZPP + @"\" + md5file.getName(); string file = pathToEZPP + @"\" + md5file.Name;
bool doesExistOnPC = File.Exists(file); bool doesExistOnPC = File.Exists(file);
if (!doesExistOnPC) if (!doesExistOnPC)
{ {
downloadList.Add(md5file.getName()); downloadList.Add(md5file.Name);
} }
else else
{ {
string onlineHash = md5file.getMD5(); string onlineHash = md5file.MD5;
string pcHash = MD5Util.CalculateMD5(file); string pcHash = MD5Util.CalculateMD5(file);
#if DEBUG #if DEBUG
MessageBox.Show("Filename: " + md5file.getName() + "\nOnline-Hash: " + onlineHash + "\n PC-Hash: " + pcHash); MessageBox.Show("Filename: " + md5file.getName() + "\nOnline-Hash: " + onlineHash + "\n PC-Hash: " + pcHash);
#endif #endif
if (!string.Equals(onlineHash, pcHash)) if (!string.Equals(onlineHash, pcHash))
{ {
downloadList.Add(md5file.getName()); downloadList.Add(md5file.Name);
} }
} }
} }

View File

@ -10,24 +10,14 @@ namespace EZPPClient_Installer
class MD5File class MD5File
{ {
private string md5; public string MD5 { get; set; }
private string name;
public string Name { get; set; }
public MD5File(string name, string md5) public MD5File(string name, string md5)
{ {
this.md5 = md5; this.MD5 = md5;
this.name = name; this.Name = name;
} }
public string getName()
{
return name;
}
public string getMD5()
{
return md5;
}
} }
} }