Change database and interface fields to more appropriate descriptions.

This commit is contained in:
2018-03-15 15:55:59 +00:00
parent 4c79151c31
commit 3825b483ee
4 changed files with 149 additions and 156 deletions

View File

@@ -70,9 +70,9 @@ namespace apprepodbmgr.Eto
get { return _item.Architecture; } get { return _item.Architecture; }
set { } set { }
} }
public string machine public string targetos
{ {
get { return _item.Machine; } get { return _item.TargetOs; }
set { } set { }
} }
public string format public string format
@@ -110,9 +110,9 @@ namespace apprepodbmgr.Eto
get { return _item.Files; } get { return _item.Files; }
set { } set { }
} }
public bool netinstall public bool Installer
{ {
get { return _item.Netinstall; } get { return _item.Installer; }
set { } set { }
} }
public byte[] xml public byte[] xml

View File

@@ -43,9 +43,9 @@
</StackLayoutItem> </StackLayoutItem>
<StackLayoutItem HorizontalAlignment="Stretch"> <StackLayoutItem HorizontalAlignment="Stretch">
<StackLayout Orientation="Horizontal"> <StackLayout Orientation="Horizontal">
<Label>Machine</Label> <Label>Target OS</Label>
<StackLayoutItem Expand="True"> <StackLayoutItem Expand="True">
<TextBox ID="txtMachine" /> <TextBox ID="txtTargetOs" />
</StackLayoutItem> </StackLayoutItem>
</StackLayout> </StackLayout>
</StackLayoutItem> </StackLayoutItem>
@@ -91,7 +91,7 @@
<CheckBox ID="chkSource">source</CheckBox> <CheckBox ID="chkSource">source</CheckBox>
</StackLayoutItem> </StackLayoutItem>
<StackLayoutItem Expand="True" HorizontalAlignment="Right"> <StackLayoutItem Expand="True" HorizontalAlignment="Right">
<CheckBox ID="chkNetinstall">netinstall</CheckBox> <CheckBox ID="chkInstaller">installer</CheckBox>
</StackLayoutItem> </StackLayoutItem>
</StackLayout> </StackLayout>
</StackLayoutItem> </StackLayoutItem>

View File

@@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using System.IO; using System.IO;
using System.Linq;
using System.Threading; using System.Threading;
using System.Xml.Serialization; using System.Xml.Serialization;
using apprepodbmgr.Core; using apprepodbmgr.Core;
@@ -130,8 +131,8 @@ namespace apprepodbmgr.Eto
}); });
treeApps.Columns.Add(new GridColumn treeApps.Columns.Add(new GridColumn
{ {
DataCell = new TextBoxCell {Binding = Binding.Property<DBEntryForEto, string>(r => r.machine)}, DataCell = new TextBoxCell {Binding = Binding.Property<DBEntryForEto, string>(r => r.targetos)},
HeaderText = "Machine" HeaderText = "Target OS"
}); });
treeApps.Columns.Add(new GridColumn treeApps.Columns.Add(new GridColumn
{ {
@@ -170,8 +171,8 @@ namespace apprepodbmgr.Eto
}); });
treeApps.Columns.Add(new GridColumn treeApps.Columns.Add(new GridColumn
{ {
DataCell = new CheckBoxCell {Binding = Binding.Property<DBEntryForEto, bool?>(r => r.netinstall)}, DataCell = new CheckBoxCell {Binding = Binding.Property<DBEntryForEto, bool?>(r => r.Installer)},
HeaderText = "NetInstall?" HeaderText = "Installer?"
}); });
treeApps.AllowMultipleSelection = false; treeApps.AllowMultipleSelection = false;
@@ -352,7 +353,7 @@ namespace apprepodbmgr.Eto
btnToggleCrack.Enabled = true; btnToggleCrack.Enabled = true;
txtFormat.ReadOnly = false; txtFormat.ReadOnly = false;
txtMachine.ReadOnly = false; txtTargetOs.ReadOnly = false;
txtProduct.ReadOnly = false; txtProduct.ReadOnly = false;
txtVersion.ReadOnly = false; txtVersion.ReadOnly = false;
txtLanguages.ReadOnly = false; txtLanguages.ReadOnly = false;
@@ -363,7 +364,7 @@ namespace apprepodbmgr.Eto
chkFiles.Enabled = true; chkFiles.Enabled = true;
chkUpdate.Enabled = true; chkUpdate.Enabled = true;
chkUpgrade.Enabled = true; chkUpgrade.Enabled = true;
chkNetinstall.Enabled = true; chkInstaller.Enabled = true;
chkSource.Enabled = true; chkSource.Enabled = true;
btnMetadata.Visible = true; btnMetadata.Visible = true;
@@ -373,7 +374,7 @@ namespace apprepodbmgr.Eto
foreach(string developer in Context.Metadata.Developer) foreach(string developer in Context.Metadata.Developer)
{ {
if(!string.IsNullOrWhiteSpace(txtDeveloper.Text)) txtDeveloper.Text += ","; if(!string.IsNullOrWhiteSpace(txtDeveloper.Text)) txtDeveloper.Text += ",";
txtDeveloper.Text += developer; txtDeveloper.Text += developer;
} }
if(!string.IsNullOrWhiteSpace(Context.Metadata.Name)) txtProduct.Text = Context.Metadata.Name; if(!string.IsNullOrWhiteSpace(Context.Metadata.Name)) txtProduct.Text = Context.Metadata.Name;
@@ -383,21 +384,22 @@ namespace apprepodbmgr.Eto
foreach(LanguagesTypeLanguage language in Context.Metadata.Languages) foreach(LanguagesTypeLanguage language in Context.Metadata.Languages)
{ {
if(!string.IsNullOrWhiteSpace(txtLanguages.Text)) txtLanguages.Text += ","; if(!string.IsNullOrWhiteSpace(txtLanguages.Text)) txtLanguages.Text += ",";
txtLanguages.Text += language; txtLanguages.Text += language;
} }
if(Context.Metadata.Architectures != null) if(Context.Metadata.Architectures != null)
foreach(ArchitecturesTypeArchitecture architecture in Context.Metadata.Architectures) foreach(ArchitecturesTypeArchitecture architecture in Context.Metadata.Architectures)
{ {
if(!string.IsNullOrWhiteSpace(txtArchitecture.Text)) txtArchitecture.Text += ","; if(!string.IsNullOrWhiteSpace(txtArchitecture.Text)) txtArchitecture.Text += ",";
txtArchitecture.Text += architecture; txtArchitecture.Text += architecture;
} }
if(Context.Metadata.Systems != null) if(Context.Metadata.RequiredOperatingSystems != null)
foreach(string machine in Context.Metadata.Systems) foreach(string targetos in Context
.Metadata.RequiredOperatingSystems.Select(os => os.Name).Distinct())
{ {
if(!string.IsNullOrWhiteSpace(txtMachine.Text)) txtMachine.Text += ","; if(!string.IsNullOrWhiteSpace(txtTargetOs.Text)) txtTargetOs.Text += ",";
txtMachine.Text += machine; txtTargetOs.Text += targetos;
} }
btnMetadata.BackgroundColor = Colors.Green; btnMetadata.BackgroundColor = Colors.Green;
@@ -414,7 +416,7 @@ namespace apprepodbmgr.Eto
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
fileView.Add(new FileEntry {Path = filename, Hash = hash, Known = known, IsCrack = isCrack}); fileView.Add(new FileEntry {Path = filename, Hash = hash, Known = known, IsCrack = isCrack});
btnPack.Enabled |= !known; btnPack.Enabled |= !known;
if(known) knownFiles++; if(known) knownFiles++;
}); });
} }
@@ -455,7 +457,7 @@ namespace apprepodbmgr.Eto
} }
txtFormat.ReadOnly = true; txtFormat.ReadOnly = true;
txtMachine.ReadOnly = true; txtTargetOs.ReadOnly = true;
txtProduct.ReadOnly = true; txtProduct.ReadOnly = true;
txtVersion.ReadOnly = true; txtVersion.ReadOnly = true;
txtLanguages.ReadOnly = true; txtLanguages.ReadOnly = true;
@@ -466,10 +468,10 @@ namespace apprepodbmgr.Eto
chkFiles.Enabled = false; chkFiles.Enabled = false;
chkUpdate.Enabled = false; chkUpdate.Enabled = false;
chkUpgrade.Enabled = false; chkUpgrade.Enabled = false;
chkNetinstall.Enabled = false; chkInstaller.Enabled = false;
chkSource.Enabled = false; chkSource.Enabled = false;
txtFormat.Text = ""; txtFormat.Text = "";
txtMachine.Text = ""; txtTargetOs.Text = "";
txtProduct.Text = ""; txtProduct.Text = "";
txtVersion.Text = ""; txtVersion.Text = "";
txtLanguages.Text = ""; txtLanguages.Text = "";
@@ -480,7 +482,7 @@ namespace apprepodbmgr.Eto
chkFiles.Checked = false; chkFiles.Checked = false;
chkUpdate.Checked = false; chkUpdate.Checked = false;
chkUpgrade.Checked = false; chkUpgrade.Checked = false;
chkNetinstall.Checked = false; chkInstaller.Checked = false;
chkSource.Checked = false; chkSource.Checked = false;
if(Context.TmpFolder != null) if(Context.TmpFolder != null)
@@ -506,11 +508,9 @@ namespace apprepodbmgr.Eto
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner)) if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner))
lblProgress.Text = $"{text}: {inner}"; lblProgress.Text = $"{text}: {inner}";
else if(!string.IsNullOrWhiteSpace(inner)) else if(!string.IsNullOrWhiteSpace(inner)) lblProgress.Text = inner;
lblProgress.Text = inner; else lblProgress.Text = text;
else
lblProgress.Text = text;
if(maximum > 0) if(maximum > 0)
{ {
if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue || if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue ||
@@ -534,11 +534,9 @@ namespace apprepodbmgr.Eto
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner)) if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner))
lblProgress2.Text = $"{text}: {inner}"; lblProgress2.Text = $"{text}: {inner}";
else if(!string.IsNullOrWhiteSpace(inner)) else if(!string.IsNullOrWhiteSpace(inner)) lblProgress2.Text = inner;
lblProgress2.Text = inner; else lblProgress2.Text = text;
else
lblProgress2.Text = text;
if(maximum > 0) if(maximum > 0)
{ {
if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue || if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue ||
@@ -710,7 +708,7 @@ namespace apprepodbmgr.Eto
btnClose.Enabled = false; btnClose.Enabled = false;
prgProgress.Visible = true; prgProgress.Visible = true;
txtFormat.ReadOnly = true; txtFormat.ReadOnly = true;
txtMachine.ReadOnly = true; txtTargetOs.ReadOnly = true;
txtProduct.ReadOnly = true; txtProduct.ReadOnly = true;
txtVersion.ReadOnly = true; txtVersion.ReadOnly = true;
txtLanguages.ReadOnly = true; txtLanguages.ReadOnly = true;
@@ -721,7 +719,7 @@ namespace apprepodbmgr.Eto
chkFiles.Enabled = false; chkFiles.Enabled = false;
chkUpdate.Enabled = false; chkUpdate.Enabled = false;
chkUpgrade.Enabled = false; chkUpgrade.Enabled = false;
chkNetinstall.Enabled = false; chkInstaller.Enabled = false;
chkSource.Enabled = false; chkSource.Enabled = false;
Workers.UpdateProgress += UpdateProgress; Workers.UpdateProgress += UpdateProgress;
@@ -733,11 +731,11 @@ namespace apprepodbmgr.Eto
Context.DbInfo.Developer = txtDeveloper.Text; Context.DbInfo.Developer = txtDeveloper.Text;
Context.DbInfo.Format = txtFormat.Text; Context.DbInfo.Format = txtFormat.Text;
Context.DbInfo.Languages = txtLanguages.Text; Context.DbInfo.Languages = txtLanguages.Text;
Context.DbInfo.Machine = txtMachine.Text; Context.DbInfo.TargetOs = txtTargetOs.Text;
Context.DbInfo.Product = txtProduct.Text; Context.DbInfo.Product = txtProduct.Text;
Context.DbInfo.Version = txtVersion.Text; Context.DbInfo.Version = txtVersion.Text;
Context.DbInfo.Files = chkFiles.Checked.Value; Context.DbInfo.Files = chkFiles.Checked.Value;
Context.DbInfo.Netinstall = chkNetinstall.Checked.Value; Context.DbInfo.Installer = chkInstaller.Checked.Value;
Context.DbInfo.Oem = chkOem.Checked.Value; Context.DbInfo.Oem = chkOem.Checked.Value;
Context.DbInfo.Source = chkSource.Checked.Value; Context.DbInfo.Source = chkSource.Checked.Value;
Context.DbInfo.Update = chkUpdate.Checked.Value; Context.DbInfo.Update = chkUpdate.Checked.Value;
@@ -749,9 +747,9 @@ namespace apprepodbmgr.Eto
XmlSerializer xs = new XmlSerializer(typeof(CICMMetadataType)); XmlSerializer xs = new XmlSerializer(typeof(CICMMetadataType));
xs.Serialize(ms, Context.Metadata); xs.Serialize(ms, Context.Metadata);
Context.DbInfo.Xml = ms.ToArray(); Context.DbInfo.Xml = ms.ToArray();
JsonSerializer js = new JsonSerializer(); JsonSerializer js = new JsonSerializer();
ms = new MemoryStream(); ms = new MemoryStream();
StreamWriter sw = new StreamWriter(ms); StreamWriter sw = new StreamWriter(ms);
js.Serialize(sw, Context.Metadata, typeof(CICMMetadataType)); js.Serialize(sw, Context.Metadata, typeof(CICMMetadataType));
Context.DbInfo.Json = ms.ToArray(); Context.DbInfo.Json = ms.ToArray();
} }
@@ -821,7 +819,7 @@ namespace apprepodbmgr.Eto
lblProgress.Visible = true; lblProgress.Visible = true;
lblProgress2.Visible = true; lblProgress2.Visible = true;
txtFormat.ReadOnly = true; txtFormat.ReadOnly = true;
txtMachine.ReadOnly = true; txtTargetOs.ReadOnly = true;
txtProduct.ReadOnly = true; txtProduct.ReadOnly = true;
txtVersion.ReadOnly = true; txtVersion.ReadOnly = true;
txtLanguages.ReadOnly = true; txtLanguages.ReadOnly = true;
@@ -832,7 +830,7 @@ namespace apprepodbmgr.Eto
chkFiles.Enabled = false; chkFiles.Enabled = false;
chkUpdate.Enabled = false; chkUpdate.Enabled = false;
chkUpgrade.Enabled = false; chkUpgrade.Enabled = false;
chkNetinstall.Enabled = false; chkInstaller.Enabled = false;
chkSource.Enabled = false; chkSource.Enabled = false;
Workers.UpdateProgress += UpdateProgress; Workers.UpdateProgress += UpdateProgress;
@@ -845,11 +843,11 @@ namespace apprepodbmgr.Eto
Context.DbInfo.Developer = txtDeveloper.Text; Context.DbInfo.Developer = txtDeveloper.Text;
Context.DbInfo.Format = txtFormat.Text; Context.DbInfo.Format = txtFormat.Text;
Context.DbInfo.Languages = txtLanguages.Text; Context.DbInfo.Languages = txtLanguages.Text;
Context.DbInfo.Machine = txtMachine.Text; Context.DbInfo.TargetOs = txtTargetOs.Text;
Context.DbInfo.Product = txtProduct.Text; Context.DbInfo.Product = txtProduct.Text;
Context.DbInfo.Version = txtVersion.Text; Context.DbInfo.Version = txtVersion.Text;
Context.DbInfo.Files = chkFiles.Checked.Value; Context.DbInfo.Files = chkFiles.Checked.Value;
Context.DbInfo.Netinstall = chkNetinstall.Checked.Value; Context.DbInfo.Installer = chkInstaller.Checked.Value;
Context.DbInfo.Oem = chkOem.Checked.Value; Context.DbInfo.Oem = chkOem.Checked.Value;
Context.DbInfo.Source = chkSource.Checked.Value; Context.DbInfo.Source = chkSource.Checked.Value;
Context.DbInfo.Update = chkUpdate.Checked.Value; Context.DbInfo.Update = chkUpdate.Checked.Value;
@@ -900,7 +898,7 @@ namespace apprepodbmgr.Eto
lblProgress.Visible = false; lblProgress.Visible = false;
lblProgress2.Visible = false; lblProgress2.Visible = false;
txtFormat.ReadOnly = false; txtFormat.ReadOnly = false;
txtMachine.ReadOnly = false; txtTargetOs.ReadOnly = false;
txtProduct.ReadOnly = false; txtProduct.ReadOnly = false;
txtVersion.ReadOnly = false; txtVersion.ReadOnly = false;
txtLanguages.ReadOnly = false; txtLanguages.ReadOnly = false;
@@ -911,7 +909,7 @@ namespace apprepodbmgr.Eto
chkFiles.Enabled = true; chkFiles.Enabled = true;
chkUpdate.Enabled = true; chkUpdate.Enabled = true;
chkUpgrade.Enabled = true; chkUpgrade.Enabled = true;
chkNetinstall.Enabled = true; chkInstaller.Enabled = true;
chkSource.Enabled = true; chkSource.Enabled = true;
}); });
} }
@@ -1058,7 +1056,7 @@ namespace apprepodbmgr.Eto
foreach(string developer in Context.Metadata.Developer) foreach(string developer in Context.Metadata.Developer)
{ {
if(!string.IsNullOrWhiteSpace(txtDeveloper.Text)) txtDeveloper.Text += ","; if(!string.IsNullOrWhiteSpace(txtDeveloper.Text)) txtDeveloper.Text += ",";
txtDeveloper.Text += developer; txtDeveloper.Text += developer;
} }
if(string.IsNullOrWhiteSpace(txtProduct.Text)) if(string.IsNullOrWhiteSpace(txtProduct.Text))
@@ -1074,7 +1072,7 @@ namespace apprepodbmgr.Eto
foreach(LanguagesTypeLanguage language in Context.Metadata.Languages) foreach(LanguagesTypeLanguage language in Context.Metadata.Languages)
{ {
if(!string.IsNullOrWhiteSpace(txtLanguages.Text)) txtLanguages.Text += ","; if(!string.IsNullOrWhiteSpace(txtLanguages.Text)) txtLanguages.Text += ",";
txtLanguages.Text += language; txtLanguages.Text += language;
} }
if(string.IsNullOrWhiteSpace(txtArchitecture.Text)) if(string.IsNullOrWhiteSpace(txtArchitecture.Text))
@@ -1082,15 +1080,16 @@ namespace apprepodbmgr.Eto
foreach(ArchitecturesTypeArchitecture architecture in Context.Metadata.Architectures) foreach(ArchitecturesTypeArchitecture architecture in Context.Metadata.Architectures)
{ {
if(!string.IsNullOrWhiteSpace(txtArchitecture.Text)) txtArchitecture.Text += ","; if(!string.IsNullOrWhiteSpace(txtArchitecture.Text)) txtArchitecture.Text += ",";
txtArchitecture.Text += architecture; txtArchitecture.Text += architecture;
} }
if(string.IsNullOrWhiteSpace(txtMachine.Text)) if(string.IsNullOrWhiteSpace(txtTargetOs.Text))
if(Context.Metadata.Systems != null) if(Context.Metadata.RequiredOperatingSystems != null)
foreach(string machine in Context.Metadata.Systems) foreach(string targetos in Context.Metadata.RequiredOperatingSystems.Select(os => os.Name)
.Distinct())
{ {
if(!string.IsNullOrWhiteSpace(txtMachine.Text)) txtMachine.Text += ","; if(!string.IsNullOrWhiteSpace(txtTargetOs.Text)) txtTargetOs.Text += ",";
txtMachine.Text += machine; txtTargetOs.Text += targetos;
} }
btnMetadata.BackgroundColor = Colors.Green; btnMetadata.BackgroundColor = Colors.Green;
@@ -1151,7 +1150,7 @@ namespace apprepodbmgr.Eto
TextBox txtVersion; TextBox txtVersion;
TextBox txtLanguages; TextBox txtLanguages;
TextBox txtArchitecture; TextBox txtArchitecture;
TextBox txtMachine; TextBox txtTargetOs;
TextBox txtFormat; TextBox txtFormat;
TextBox txtDescription; TextBox txtDescription;
CheckBox chkOem; CheckBox chkOem;
@@ -1159,7 +1158,7 @@ namespace apprepodbmgr.Eto
CheckBox chkUpgrade; CheckBox chkUpgrade;
CheckBox chkFiles; CheckBox chkFiles;
CheckBox chkSource; CheckBox chkSource;
CheckBox chkNetinstall; CheckBox chkInstaller;
GridView treeFiles; GridView treeFiles;
TabPage tabApps; TabPage tabApps;
GridView treeApps; GridView treeApps;

View File

@@ -89,8 +89,8 @@ namespace apprepodbmgr.Eto
}); });
treeApps.Columns.Add(new GridColumn treeApps.Columns.Add(new GridColumn
{ {
DataCell = new TextBoxCell {Binding = Binding.Property<DBEntryForEto, string>(r => r.machine)}, DataCell = new TextBoxCell {Binding = Binding.Property<DBEntryForEto, string>(r => r.targetos)},
HeaderText = "Machine" HeaderText = "Target OS"
}); });
treeApps.Columns.Add(new GridColumn treeApps.Columns.Add(new GridColumn
{ {
@@ -129,8 +129,8 @@ namespace apprepodbmgr.Eto
}); });
treeApps.Columns.Add(new GridColumn treeApps.Columns.Add(new GridColumn
{ {
DataCell = new CheckBoxCell {Binding = Binding.Property<DBEntryForEto, bool?>(r => r.netinstall)}, DataCell = new CheckBoxCell {Binding = Binding.Property<DBEntryForEto, bool?>(r => r.Installer)},
HeaderText = "NetInstall?" HeaderText = "Installer?"
}); });
treeApps.AllowMultipleSelection = false; treeApps.AllowMultipleSelection = false;
@@ -188,8 +188,8 @@ namespace apprepodbmgr.Eto
HeaderText = "Virus" HeaderText = "Virus"
}); });
treeFiles.AllowMultipleSelection = false; treeFiles.AllowMultipleSelection = false;
treeFiles.CellFormatting += (sender, e) => treeFiles.CellFormatting += (sender, e) =>
{ {
if(((DbFile)e.Item).HasVirus.HasValue) if(((DbFile)e.Item).HasVirus.HasValue)
e.BackgroundColor = ((DbFile)e.Item).HasVirus.Value ? Colors.Red : Colors.Green; e.BackgroundColor = ((DbFile)e.Item).HasVirus.Value ? Colors.Red : Colors.Green;
@@ -267,11 +267,9 @@ namespace apprepodbmgr.Eto
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner)) if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner))
lblProgress.Text = $"{text}: {inner}"; lblProgress.Text = $"{text}: {inner}";
else if(!string.IsNullOrWhiteSpace(inner)) else if(!string.IsNullOrWhiteSpace(inner)) lblProgress.Text = inner;
lblProgress.Text = inner; else lblProgress.Text = text;
else
lblProgress.Text = text;
if(maximum > 0) if(maximum > 0)
{ {
if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue || if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue ||
@@ -295,11 +293,9 @@ namespace apprepodbmgr.Eto
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner)) if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner))
lblProgress2.Text = $"{text}: {inner}"; lblProgress2.Text = $"{text}: {inner}";
else if(!string.IsNullOrWhiteSpace(inner)) else if(!string.IsNullOrWhiteSpace(inner)) lblProgress2.Text = inner;
lblProgress2.Text = inner; else lblProgress2.Text = text;
else
lblProgress2.Text = text;
if(maximum > 0) if(maximum > 0)
{ {
if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue || if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue ||
@@ -325,7 +321,7 @@ namespace apprepodbmgr.Eto
protected void OnBtnAddClicked(object sender, EventArgs e) protected void OnBtnAddClicked(object sender, EventArgs e)
{ {
dlgAdd dlgAdd = new dlgAdd(); dlgAdd dlgAdd = new dlgAdd();
dlgAdd.OnAddedApp += app => { lstApps.Add(new DBEntryForEto(app)); }; dlgAdd.OnAddedApp += app => { lstApps.Add(new DBEntryForEto(app)); };
dlgAdd.ShowModal(this); dlgAdd.ShowModal(this);
} }
@@ -502,8 +498,8 @@ namespace apprepodbmgr.Eto
btnRemove.Visible = false; btnRemove.Visible = false;
btnCompress.Visible = false; btnCompress.Visible = false;
btnSave.Visible = false; btnSave.Visible = false;
btnSettings.Enabled = false; btnSettings.Enabled = false;
btnStop.Visible = true; btnStop.Visible = true;
Workers.Failed += CompressToFailed; Workers.Failed += CompressToFailed;
Workers.Finished += CompressToFinished; Workers.Finished += CompressToFinished;
@@ -628,7 +624,7 @@ namespace apprepodbmgr.Eto
if(treeFiles.SelectedItem == null) return; if(treeFiles.SelectedItem == null) return;
DbFile file = Workers.GetDBFile(((DbFile)treeFiles.SelectedItem).Sha256); DbFile file = Workers.GetDBFile(((DbFile)treeFiles.SelectedItem).Sha256);
outIter = (DbFile)treeFiles.SelectedItem; outIter = (DbFile)treeFiles.SelectedItem;
if(file == null) if(file == null)
{ {
@@ -678,20 +674,21 @@ namespace apprepodbmgr.Eto
{ {
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
treeFiles.Enabled = true; treeFiles.Enabled = true;
btnToggleCrack.Enabled = true; btnToggleCrack.Enabled = true;
btnScanWithClamd.Enabled = true; btnScanWithClamd.Enabled = true;
btnCheckInVirusTotal.Enabled = true; btnCheckInVirusTotal.Enabled = true;
Workers.Failed -= ClamdFailed; Workers.Failed -= ClamdFailed;
Workers.ScanFinished -= ClamdFinished; Workers.ScanFinished -= ClamdFinished;
Workers.UpdateProgress -= UpdateVirusProgress; Workers.UpdateProgress -= UpdateVirusProgress;
lblProgressFiles1.Text = ""; lblProgressFiles1.Text = "";
prgProgressFiles1.Visible = false; prgProgressFiles1.Visible = false;
lblProgressFiles1.Visible = false; lblProgressFiles1.Visible = false;
if(thdScanFile != null) thdScanFile = null; if(thdScanFile != null) thdScanFile = null;
if((!outIter.HasVirus.HasValue || outIter.HasVirus.HasValue && !outIter.HasVirus.Value) && if((!outIter.HasVirus.HasValue || outIter.HasVirus.HasValue && !outIter.HasVirus.Value) &&
file.HasVirus.HasValue && file.HasVirus.Value) infectedFiles++; file.HasVirus.HasValue &&
file.HasVirus.Value) infectedFiles++;
lstFiles.Remove(outIter); lstFiles.Remove(outIter);
AddFile(file); AddFile(file);
@@ -705,7 +702,7 @@ namespace apprepodbmgr.Eto
if(treeFiles.SelectedItem == null) return; if(treeFiles.SelectedItem == null) return;
DbFile file = Workers.GetDBFile(((DbFile)treeFiles.SelectedItem).Sha256); DbFile file = Workers.GetDBFile(((DbFile)treeFiles.SelectedItem).Sha256);
outIter = (DbFile)treeFiles.SelectedItem; outIter = (DbFile)treeFiles.SelectedItem;
if(file == null) if(file == null)
{ {
@@ -734,16 +731,16 @@ namespace apprepodbmgr.Eto
{ {
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
treeFiles.Enabled = true; treeFiles.Enabled = true;
btnToggleCrack.Enabled = true; btnToggleCrack.Enabled = true;
btnScanWithClamd.Enabled = true; btnScanWithClamd.Enabled = true;
btnCheckInVirusTotal.Enabled = true; btnCheckInVirusTotal.Enabled = true;
prgProgressFiles1.Visible = false; prgProgressFiles1.Visible = false;
Workers.Failed -= VirusTotalFailed; Workers.Failed -= VirusTotalFailed;
Workers.ScanFinished -= VirusTotalFinished; Workers.ScanFinished -= VirusTotalFinished;
Workers.UpdateProgress -= UpdateVirusProgress; Workers.UpdateProgress -= UpdateVirusProgress;
lblProgressFiles1.Text = ""; lblProgressFiles1.Text = "";
if(thdScanFile != null) thdScanFile = null; if(thdScanFile != null) thdScanFile = null;
MessageBox.Show(text, MessageBoxType.Error); MessageBox.Show(text, MessageBoxType.Error);
}); });
} }
@@ -752,19 +749,20 @@ namespace apprepodbmgr.Eto
{ {
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
treeFiles.Enabled = true; treeFiles.Enabled = true;
btnToggleCrack.Enabled = true; btnToggleCrack.Enabled = true;
btnScanWithClamd.Enabled = true; btnScanWithClamd.Enabled = true;
btnCheckInVirusTotal.Enabled = true; btnCheckInVirusTotal.Enabled = true;
Workers.Failed -= VirusTotalFailed; Workers.Failed -= VirusTotalFailed;
Workers.ScanFinished -= VirusTotalFinished; Workers.ScanFinished -= VirusTotalFinished;
Workers.UpdateProgress -= UpdateVirusProgress; Workers.UpdateProgress -= UpdateVirusProgress;
lblProgressFiles1.Text = ""; lblProgressFiles1.Text = "";
prgProgressFiles1.Visible = false; prgProgressFiles1.Visible = false;
if(thdScanFile != null) thdScanFile = null; if(thdScanFile != null) thdScanFile = null;
if((!outIter.HasVirus.HasValue || outIter.HasVirus.HasValue && !outIter.HasVirus.Value) && if((!outIter.HasVirus.HasValue || outIter.HasVirus.HasValue && !outIter.HasVirus.Value) &&
file.HasVirus.HasValue && file.HasVirus.Value) infectedFiles++; file.HasVirus.HasValue &&
file.HasVirus.Value) infectedFiles++;
lstFiles.Remove(outIter); lstFiles.Remove(outIter);
AddFile(file); AddFile(file);
@@ -805,11 +803,9 @@ namespace apprepodbmgr.Eto
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner)) if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner))
lblProgressFiles1.Text = $"{text}: {inner}"; lblProgressFiles1.Text = $"{text}: {inner}";
else if(!string.IsNullOrWhiteSpace(inner)) else if(!string.IsNullOrWhiteSpace(inner)) lblProgressFiles1.Text = inner;
lblProgressFiles1.Text = inner; else lblProgressFiles1.Text = text;
else
lblProgressFiles1.Text = text;
if(maximum > 0) if(maximum > 0)
{ {
if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue || if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue ||
@@ -833,11 +829,9 @@ namespace apprepodbmgr.Eto
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner)) if(!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(inner))
lblProgressFiles2.Text = $"{text}: {inner}"; lblProgressFiles2.Text = $"{text}: {inner}";
else if(!string.IsNullOrWhiteSpace(inner)) else if(!string.IsNullOrWhiteSpace(inner)) lblProgressFiles2.Text = inner;
lblProgressFiles2.Text = inner; else lblProgressFiles2.Text = text;
else
lblProgressFiles2.Text = text;
if(maximum > 0) if(maximum > 0)
{ {
if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue || if(current < int.MinValue || current > int.MaxValue || maximum < int.MinValue ||
@@ -971,21 +965,21 @@ namespace apprepodbmgr.Eto
{ {
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
treeFiles.Enabled = true; treeFiles.Enabled = true;
btnToggleCrack.Enabled = true; btnToggleCrack.Enabled = true;
btnScanWithClamd.Enabled = true; btnScanWithClamd.Enabled = true;
btnCheckInVirusTotal.Enabled = true; btnCheckInVirusTotal.Enabled = true;
btnScanAllPending.Enabled = true; btnScanAllPending.Enabled = true;
Workers.Finished -= AllClamdFinished; Workers.Finished -= AllClamdFinished;
Workers.UpdateProgress -= UpdateVirusProgress2; Workers.UpdateProgress -= UpdateVirusProgress2;
Workers.UpdateProgress2 -= UpdateFileProgress; Workers.UpdateProgress2 -= UpdateFileProgress;
lblProgressFiles1.Text = ""; lblProgressFiles1.Text = "";
prgProgressFiles1.Visible = false; prgProgressFiles1.Visible = false;
lblProgressFiles2.Text = ""; lblProgressFiles2.Text = "";
prgProgressFiles2.Visible = false; prgProgressFiles2.Visible = false;
btnStopFiles.Visible = false; btnStopFiles.Visible = false;
scanningFiles = false; scanningFiles = false;
if(thdScanFile != null) thdScanFile = null; if(thdScanFile != null) thdScanFile = null;
OnBtnPopulateFilesClicked(null, new EventArgs()); OnBtnPopulateFilesClicked(null, new EventArgs());
}); });
@@ -1033,25 +1027,25 @@ namespace apprepodbmgr.Eto
{ {
Application.Instance.Invoke(delegate Application.Instance.Invoke(delegate
{ {
btnCleanFiles.Visible = true; btnCleanFiles.Visible = true;
btnToggleCrack.Visible = true; btnToggleCrack.Visible = true;
btnScanWithClamd.Visible = true; btnScanWithClamd.Visible = true;
btnScanAllPending.Visible = true; btnScanAllPending.Visible = true;
btnCheckInVirusTotal.Visible = true; btnCheckInVirusTotal.Visible = true;
tabApps.Enabled = true; tabApps.Enabled = true;
treeFiles.Enabled = true; treeFiles.Enabled = true;
Workers.Finished -= CleanFilesFinished; Workers.Finished -= CleanFilesFinished;
Workers.UpdateProgress -= UpdateFileProgress; Workers.UpdateProgress -= UpdateFileProgress;
Workers.UpdateProgress2 -= UpdateFileProgress2; Workers.UpdateProgress2 -= UpdateFileProgress2;
lblProgressFiles1.Text = ""; lblProgressFiles1.Text = "";
prgProgressFiles1.Visible = false; prgProgressFiles1.Visible = false;
lblProgressFiles2.Text = ""; lblProgressFiles2.Text = "";
prgProgressFiles2.Visible = false; prgProgressFiles2.Visible = false;
btnSettings.Enabled = true; btnSettings.Enabled = true;
mnuCompress.Enabled = true; mnuCompress.Enabled = true;
btnQuit.Enabled = true; btnQuit.Enabled = true;
mnuFile.Enabled = true; mnuFile.Enabled = true;
if(thdCleanFiles != null) thdCleanFiles = null; if(thdCleanFiles != null) thdCleanFiles = null;
OnBtnPopulateFilesClicked(null, new EventArgs()); OnBtnPopulateFilesClicked(null, new EventArgs());
}); });