2019-09-08 21:39:04 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using UpTool2.Properties;
|
|
|
|
|
using System.Xml.Linq;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO.Compression;
|
|
|
|
|
using System.Security.Cryptography;
|
2019-09-10 12:20:00 +02:00
|
|
|
|
using System.Linq;
|
2019-09-29 16:19:57 +02:00
|
|
|
|
using Microsoft.VisualBasic;
|
2019-09-08 21:39:04 +02:00
|
|
|
|
|
|
|
|
|
namespace UpTool2
|
|
|
|
|
{
|
|
|
|
|
public partial class MainForm : Form
|
|
|
|
|
{
|
2019-09-10 10:02:24 +02:00
|
|
|
|
Dictionary<Guid, App> apps = new Dictionary<Guid, App>();
|
2019-09-29 16:19:57 +02:00
|
|
|
|
enum Status { Not_Installed = 1, Updatable = 2, Installed = 4, Local = 8, All = 15 }
|
2019-09-08 21:39:04 +02:00
|
|
|
|
string dir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\UpTool2";
|
|
|
|
|
public MainForm()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-09-10 10:02:24 +02:00
|
|
|
|
filterBox.DataSource = Enum.GetValues(typeof(Status));
|
2019-09-08 21:39:04 +02:00
|
|
|
|
reloadElements();
|
|
|
|
|
if (!Directory.Exists(dir + @"\Apps"))
|
|
|
|
|
Directory.CreateDirectory(dir + @"\Apps");
|
|
|
|
|
}
|
2019-09-09 17:50:33 +02:00
|
|
|
|
|
|
|
|
|
private void MainForm_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Program.splash.Hide();
|
|
|
|
|
BringToFront();
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-08 21:39:04 +02:00
|
|
|
|
void reloadElements()
|
|
|
|
|
{
|
|
|
|
|
//remove
|
2019-09-09 19:18:33 +02:00
|
|
|
|
toolTip.RemoveAll();
|
2019-09-10 10:02:24 +02:00
|
|
|
|
clearSelection();
|
2019-09-09 19:18:33 +02:00
|
|
|
|
infoPanel_Title.Invalidate();
|
|
|
|
|
infoPanel_Description.Invalidate();
|
2019-09-08 21:39:04 +02:00
|
|
|
|
int F = sidebarPanel.Controls.Count;
|
|
|
|
|
for (int i = 0; i < F; i++)
|
|
|
|
|
{
|
|
|
|
|
sidebarPanel.Controls[0].Dispose();
|
|
|
|
|
}
|
|
|
|
|
apps.Clear();
|
|
|
|
|
//add
|
2019-09-09 19:18:33 +02:00
|
|
|
|
toolTip.SetToolTip(controls_settings, "Settings");
|
|
|
|
|
toolTip.SetToolTip(controls_reload, "Refresh repositories");
|
2019-09-29 16:19:57 +02:00
|
|
|
|
toolTip.SetToolTip(controls_upload, "Install package from disk");
|
2019-09-10 10:02:24 +02:00
|
|
|
|
toolTip.SetToolTip(filterBox, "Filter");
|
2019-09-09 19:18:33 +02:00
|
|
|
|
toolTip.SetToolTip(action_install, "Install");
|
|
|
|
|
toolTip.SetToolTip(action_remove, "Remove");
|
|
|
|
|
toolTip.SetToolTip(action_update, "Update");
|
2019-09-10 10:02:24 +02:00
|
|
|
|
toolTip.SetToolTip(action_run, "Run");
|
2019-09-08 21:39:04 +02:00
|
|
|
|
WebClient client = new WebClient();
|
|
|
|
|
for (int i = 0; i < Settings.Default.Repos.Count; i++)
|
|
|
|
|
{
|
2019-09-10 10:02:24 +02:00
|
|
|
|
#if !DEBUG
|
2019-09-08 21:39:04 +02:00
|
|
|
|
try
|
|
|
|
|
{
|
2019-09-10 10:02:24 +02:00
|
|
|
|
#endif
|
|
|
|
|
//get info
|
2019-09-08 21:39:04 +02:00
|
|
|
|
XDocument repo = XDocument.Load(Settings.Default.Repos[i]);
|
2019-09-09 14:04:53 +02:00
|
|
|
|
foreach (XElement el in repo.Element("repo").Elements("app"))
|
2019-09-08 21:39:04 +02:00
|
|
|
|
{
|
|
|
|
|
int version = int.Parse(el.Element("Version").Value);
|
|
|
|
|
Guid ID = Guid.Parse(el.Element("ID").Value);
|
2019-09-10 10:02:24 +02:00
|
|
|
|
if (!(apps.ContainsKey(ID) && apps[ID].version >= version))
|
|
|
|
|
{
|
|
|
|
|
string name = el.Element("Name").Value;
|
|
|
|
|
string description = el.Element("Description").Value;
|
|
|
|
|
string file = el.Element("File").Value;
|
|
|
|
|
string hash = el.Element("Hash").Value;
|
|
|
|
|
bool runnable = el.Element("MainFile") != null;
|
|
|
|
|
string mainFile = "";
|
|
|
|
|
if (runnable)
|
|
|
|
|
mainFile = el.Element("MainFile").Value;
|
|
|
|
|
Color color = ColorTranslator.FromHtml(el.Element("Color").Value);
|
2019-09-29 16:19:57 +02:00
|
|
|
|
Image icon = el.Element("Icon") == null ? Resources.C_64.ToBitmap() : Image.FromStream(client.OpenRead(el.Element("Icon").Value));
|
|
|
|
|
apps[ID] = new App(name, description, version, file, false, hash, ID, color, icon, runnable, mainFile);
|
2019-09-10 10:02:24 +02:00
|
|
|
|
}
|
2019-09-10 12:20:00 +02:00
|
|
|
|
}
|
2019-09-10 10:02:24 +02:00
|
|
|
|
#if !DEBUG
|
2019-09-08 21:39:04 +02:00
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(e.ToString(), "Failed to load repo: " + Settings.Default.Repos[i]);
|
|
|
|
|
}
|
2019-09-10 10:02:24 +02:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2019-09-29 16:19:57 +02:00
|
|
|
|
string[] localApps = Directory.GetDirectories(dir + @"\Apps\");
|
|
|
|
|
for (int i = 0; i < localApps.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
Guid tmp = Guid.Parse(Path.GetFileName(localApps[i]));
|
|
|
|
|
if (!apps.ContainsKey(tmp))
|
|
|
|
|
{
|
|
|
|
|
XElement data = XDocument.Load(dir + @"\Apps\" + tmp.ToString() + @"\info.xml").Element("app");
|
|
|
|
|
apps.Add(tmp, new App("(local) " + data.Element("Name").Value, data.Element("Description").Value, -1, "", true, "", tmp, Color.Red, Resources.C_64.ToBitmap(), data.Element("MainFile") != null, data.Element("MainFile") == null ? "" : data.Element("MainFile").Value));
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-10 12:20:00 +02:00
|
|
|
|
List<App> tmp_appslist = new List<App>(apps.Values);
|
|
|
|
|
tmp_appslist.Sort((x, y) => x.name.CompareTo(y.name));
|
|
|
|
|
foreach ((App app, Panel sidebarIcon) in from App app in tmp_appslist let sidebarIcon = new Panel() select (app, sidebarIcon))
|
2019-09-10 10:02:24 +02:00
|
|
|
|
{
|
|
|
|
|
sidebarIcon.Tag = app;
|
|
|
|
|
sidebarIcon.BackColor = app.color;
|
|
|
|
|
sidebarIcon.Size = new Size(70, 70);
|
|
|
|
|
sidebarIcon.BackgroundImage = app.icon;
|
|
|
|
|
sidebarIcon.BackgroundImageLayout = ImageLayout.Stretch;
|
2019-09-10 12:20:00 +02:00
|
|
|
|
sidebarIcon.Click += (object sender, EventArgs e) => {
|
2019-09-10 10:02:24 +02:00
|
|
|
|
infoPanel_Title.Text = app.name;
|
2019-09-29 16:19:57 +02:00
|
|
|
|
infoPanel_Title.ForeColor = app.local ? Color.Red : Color.Black;
|
2019-09-10 10:02:24 +02:00
|
|
|
|
infoPanel_Description.Text = app.description;
|
|
|
|
|
action_install.Tag = app;
|
2019-09-29 16:19:57 +02:00
|
|
|
|
action_install.Enabled = !(app.local || Directory.Exists(dir + @"\Apps\" + app.ID.ToString()));
|
2019-09-10 10:02:24 +02:00
|
|
|
|
action_remove.Tag = app;
|
|
|
|
|
action_remove.Enabled = Directory.Exists(dir + @"\Apps\" + app.ID.ToString());
|
|
|
|
|
action_update.Tag = app;
|
|
|
|
|
string xml = dir + @"\Apps\" + app.ID.ToString() + @"\info.xml";
|
2019-09-29 16:19:57 +02:00
|
|
|
|
action_update.Enabled = (!app.local) && File.Exists(xml) && int.Parse(XDocument.Load(xml).Element("app").Element("Version").Value) < app.version;
|
2019-09-10 10:02:24 +02:00
|
|
|
|
action_run.Tag = app;
|
2019-09-29 16:19:57 +02:00
|
|
|
|
action_run.Enabled = (!app.local) && app.runnable && Directory.Exists(dir + @"\Apps\" + app.ID.ToString());
|
2019-09-10 10:02:24 +02:00
|
|
|
|
};
|
|
|
|
|
toolTip.SetToolTip(sidebarIcon, app.name);
|
|
|
|
|
sidebarPanel.Controls.Add(sidebarIcon);
|
2019-09-08 21:39:04 +02:00
|
|
|
|
}
|
|
|
|
|
client.Dispose();
|
2019-09-10 10:02:24 +02:00
|
|
|
|
updateSidebarV(null, null);
|
2019-09-08 21:39:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Controls_settings_Click(object sender, EventArgs e) => new SettingsForm().Show();
|
|
|
|
|
|
2019-09-09 19:18:33 +02:00
|
|
|
|
private void Controls_reload_Click(object sender, EventArgs e) => reloadElements();
|
2019-09-08 21:39:04 +02:00
|
|
|
|
|
2019-09-10 10:02:24 +02:00
|
|
|
|
private void Action_run_Click(object sender, EventArgs e)
|
2019-09-08 21:39:04 +02:00
|
|
|
|
{
|
2019-09-10 10:02:24 +02:00
|
|
|
|
string app = dir + @"\Apps\" + ((App)action_run.Tag).ID.ToString();
|
|
|
|
|
Process.Start(new ProcessStartInfo { FileName = app + "\\app\\" + ((App)action_run.Tag).mainFile, WorkingDirectory = app + @"\app" });
|
2019-09-08 21:39:04 +02:00
|
|
|
|
}
|
2019-09-10 10:02:24 +02:00
|
|
|
|
|
2019-09-08 21:39:04 +02:00
|
|
|
|
bool relE = true;
|
|
|
|
|
private void Action_remove_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string app = dir + @"\Apps\" + ((App)action_remove.Tag).ID.ToString();
|
|
|
|
|
string tmp = dir + @"\tmp";
|
|
|
|
|
if (Directory.Exists(tmp))
|
|
|
|
|
Directory.Delete(tmp, true);
|
|
|
|
|
Directory.CreateDirectory(tmp);
|
|
|
|
|
ZipFile.ExtractToDirectory(app + @"\package.zip", tmp);
|
|
|
|
|
Process.Start(new ProcessStartInfo { FileName = "cmd.exe", Arguments = "/C \"" + tmp + "\\Remove.bat\"", WorkingDirectory = app + @"\app" }).WaitForExit();
|
|
|
|
|
Directory.Delete(tmp, true);
|
|
|
|
|
Directory.Delete(app, true);
|
|
|
|
|
if (relE)
|
|
|
|
|
reloadElements();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e1)
|
|
|
|
|
{
|
|
|
|
|
if (!relE)
|
|
|
|
|
throw;
|
|
|
|
|
MessageBox.Show(e1.ToString(), "Removal failed");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Action_update_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
relE = false;
|
|
|
|
|
Action_remove_Click(sender, e);
|
|
|
|
|
Action_install_Click(sender, e);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e1)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(e1.ToString(), "Install failed");
|
|
|
|
|
}
|
2019-09-10 12:06:15 +02:00
|
|
|
|
reloadElements();
|
2019-09-08 21:39:04 +02:00
|
|
|
|
relE = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Action_install_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string app = "";
|
|
|
|
|
string tmp = "";
|
2019-09-29 16:19:57 +02:00
|
|
|
|
#if !DEBUG
|
2019-09-08 21:39:04 +02:00
|
|
|
|
try
|
|
|
|
|
{
|
2019-09-29 16:19:57 +02:00
|
|
|
|
#endif
|
2019-09-08 21:39:04 +02:00
|
|
|
|
App appI = (App)action_install.Tag;
|
|
|
|
|
app = dir + @"\Apps\" + appI.ID.ToString();
|
|
|
|
|
tmp = dir + @"\tmp";
|
|
|
|
|
if (Directory.Exists(tmp))
|
|
|
|
|
Directory.Delete(tmp, true);
|
|
|
|
|
Directory.CreateDirectory(tmp);
|
|
|
|
|
if (Directory.Exists(app))
|
|
|
|
|
Directory.Delete(app, true);
|
|
|
|
|
Directory.CreateDirectory(app);
|
2019-09-10 12:06:15 +02:00
|
|
|
|
if (new DownloadDialog(appI.file, app + @"\package.zip").ShowDialog() != DialogResult.OK)
|
|
|
|
|
throw new Exception("Download failed");
|
2019-09-08 21:39:04 +02:00
|
|
|
|
SHA256CryptoServiceProvider sha256 = new SHA256CryptoServiceProvider();
|
|
|
|
|
if (BitConverter.ToString(sha256.ComputeHash(File.ReadAllBytes(app + @"\package.zip"))).Replace("-", string.Empty).ToUpper() != appI.hash)
|
|
|
|
|
throw new Exception("The hash is not equal to the one stored in the repo");
|
2019-09-09 16:53:11 +02:00
|
|
|
|
sha256.Dispose();
|
2019-09-29 16:19:57 +02:00
|
|
|
|
completeInstall(app, appI);
|
|
|
|
|
#if !DEBUG
|
2019-09-08 21:39:04 +02:00
|
|
|
|
}
|
|
|
|
|
catch (Exception e1)
|
|
|
|
|
{
|
|
|
|
|
if (!relE)
|
|
|
|
|
throw;
|
|
|
|
|
if (Directory.Exists(app))
|
|
|
|
|
Directory.Delete(app, true);
|
|
|
|
|
MessageBox.Show(e1.ToString(), "Install failed");
|
|
|
|
|
}
|
2019-09-29 16:19:57 +02:00
|
|
|
|
#endif
|
|
|
|
|
Directory.Delete(tmp, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void controls_upload_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string app = "";
|
|
|
|
|
string tmp = "";
|
|
|
|
|
#if !DEBUG
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
#endif
|
|
|
|
|
if (searchPackageDialog.ShowDialog() == DialogResult.OK)
|
|
|
|
|
{
|
|
|
|
|
Guid ID = Guid.NewGuid();
|
|
|
|
|
app = dir + @"\Apps\" + ID.ToString();
|
|
|
|
|
while (Directory.Exists(app))
|
|
|
|
|
{
|
|
|
|
|
ID = Guid.NewGuid();
|
|
|
|
|
app = dir + @"\Apps\" + ID.ToString();
|
|
|
|
|
}
|
|
|
|
|
App appI = new App(Interaction.InputBox("Name:"), "Locally installed package, removal only", -1, "", true, "", ID, Color.Red, Resources.C_64.ToBitmap(), false, "");
|
|
|
|
|
Directory.CreateDirectory(app);
|
|
|
|
|
tmp = dir + @"\tmp";
|
|
|
|
|
if (Directory.Exists(tmp))
|
|
|
|
|
Directory.Delete(tmp, true);
|
|
|
|
|
Directory.CreateDirectory(tmp);
|
|
|
|
|
File.Copy(searchPackageDialog.FileName, app + @"\package.zip");
|
|
|
|
|
completeInstall(app, appI);
|
|
|
|
|
}
|
|
|
|
|
#if !DEBUG
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e1)
|
|
|
|
|
{
|
|
|
|
|
if (!relE)
|
|
|
|
|
throw;
|
|
|
|
|
if (Directory.Exists(app))
|
|
|
|
|
Directory.Delete(app, true);
|
|
|
|
|
MessageBox.Show(e1.ToString(), "Install failed");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2019-09-29 16:32:16 +02:00
|
|
|
|
if (tmp != "" && Directory.Exists(tmp))
|
|
|
|
|
Directory.Delete(tmp, true);
|
2019-09-29 16:19:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void completeInstall(string app, App appI)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string tmp = dir + @"\tmp";
|
|
|
|
|
ZipFile.ExtractToDirectory(app + @"\package.zip", tmp);
|
|
|
|
|
Directory.Move(tmp + @"\Data", app + @"\app");
|
|
|
|
|
if (appI.runnable)
|
|
|
|
|
new XElement("app", new XElement("Name", appI.name), new XElement("Description", appI.description), new XElement("Version", appI.version), new XElement("MainFile", appI.mainFile)).Save(app + @"\info.xml");
|
|
|
|
|
else
|
|
|
|
|
new XElement("app", new XElement("Name", appI.name), new XElement("Description", appI.description), new XElement("Version", appI.version)).Save(app + @"\info.xml");
|
|
|
|
|
Process.Start(new ProcessStartInfo { FileName = "cmd.exe", Arguments = "/C \"" + tmp + "\\Install.bat\"", WorkingDirectory = app + @"\app" }).WaitForExit();
|
|
|
|
|
if (relE)
|
|
|
|
|
reloadElements();
|
|
|
|
|
}
|
|
|
|
|
catch { throw; }
|
2019-09-08 21:39:04 +02:00
|
|
|
|
}
|
2019-09-09 17:50:33 +02:00
|
|
|
|
|
2019-09-10 10:02:24 +02:00
|
|
|
|
void clearSelection()
|
|
|
|
|
{
|
|
|
|
|
action_install.Enabled = false;
|
|
|
|
|
action_remove.Enabled = false;
|
|
|
|
|
action_update.Enabled = false;
|
|
|
|
|
action_run.Enabled = false;
|
|
|
|
|
infoPanel_Title.Text = "";
|
|
|
|
|
infoPanel_Description.Text = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateSidebarV(object sender, EventArgs e)
|
2019-09-09 17:50:33 +02:00
|
|
|
|
{
|
2019-09-10 10:02:24 +02:00
|
|
|
|
Enum.TryParse(filterBox.SelectedValue.ToString(), out Status status);
|
2019-09-09 17:50:33 +02:00
|
|
|
|
for (int i = 0; i < sidebarPanel.Controls.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
Panel sidebarIcon = (Panel)sidebarPanel.Controls[i];
|
2019-09-10 10:02:24 +02:00
|
|
|
|
App app = (App)sidebarIcon.Tag;
|
2019-09-29 16:19:57 +02:00
|
|
|
|
sidebarIcon.Visible = app.name.Contains(searchBox.Text) && ((int)app.status & (int)status) != 0;
|
2019-09-10 10:02:24 +02:00
|
|
|
|
}
|
|
|
|
|
clearSelection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private struct App : IEquatable<App>
|
|
|
|
|
{
|
|
|
|
|
public string name;
|
|
|
|
|
public string description;
|
|
|
|
|
public int version;
|
|
|
|
|
public string file;
|
2019-09-29 16:19:57 +02:00
|
|
|
|
public bool local;
|
2019-09-10 10:02:24 +02:00
|
|
|
|
public string hash;
|
|
|
|
|
public Guid ID;
|
|
|
|
|
public Color color;
|
|
|
|
|
public Image icon;
|
|
|
|
|
public bool runnable;
|
|
|
|
|
public string mainFile;
|
|
|
|
|
|
2019-09-29 16:19:57 +02:00
|
|
|
|
public App(string name, string description, int version, string file, bool local, string hash, Guid iD, Color color, Image icon, bool runnable, string mainFile)
|
2019-09-10 10:02:24 +02:00
|
|
|
|
{
|
|
|
|
|
this.name = name ?? throw new ArgumentNullException(nameof(name));
|
|
|
|
|
this.description = description ?? throw new ArgumentNullException(nameof(description));
|
|
|
|
|
this.version = version;
|
|
|
|
|
this.file = file ?? throw new ArgumentNullException(nameof(file));
|
2019-09-29 16:19:57 +02:00
|
|
|
|
this.local = local;
|
2019-09-10 10:02:24 +02:00
|
|
|
|
this.hash = hash ?? throw new ArgumentNullException(nameof(hash));
|
|
|
|
|
ID = iD;
|
|
|
|
|
this.color = color;
|
|
|
|
|
this.icon = icon ?? throw new ArgumentNullException(nameof(icon));
|
|
|
|
|
this.runnable = runnable;
|
|
|
|
|
this.mainFile = mainFile ?? throw new ArgumentNullException(nameof(mainFile));
|
2019-09-09 17:50:33 +02:00
|
|
|
|
}
|
2019-09-10 10:02:24 +02:00
|
|
|
|
|
|
|
|
|
public Status status
|
|
|
|
|
{
|
|
|
|
|
get {
|
|
|
|
|
string dir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\UpTool2";
|
|
|
|
|
string xml = dir + @"\Apps\" + ID.ToString() + @"\info.xml";
|
|
|
|
|
if (File.Exists(xml))
|
|
|
|
|
{
|
|
|
|
|
if (int.Parse(XDocument.Load(xml).Element("app").Element("Version").Value) < version)
|
|
|
|
|
return Status.Updatable;
|
|
|
|
|
else
|
2019-09-29 16:19:57 +02:00
|
|
|
|
{
|
|
|
|
|
return local ? Status.Installed | Status.Local : Status.Installed;
|
|
|
|
|
}
|
2019-09-10 10:02:24 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return Status.Not_Installed;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj) => obj is App app && Equals(app);
|
|
|
|
|
public bool Equals(App other) => ID.Equals(other.ID);
|
|
|
|
|
public override int GetHashCode() => 1213502048 + EqualityComparer<Guid>.Default.GetHashCode(ID);
|
|
|
|
|
public static bool operator ==(App left, App right) => left.Equals(right);
|
|
|
|
|
public static bool operator !=(App left, App right) => !(left == right);
|
2019-09-09 17:50:33 +02:00
|
|
|
|
}
|
2019-09-08 21:39:04 +02:00
|
|
|
|
}
|
|
|
|
|
}
|