-
Notifications
You must be signed in to change notification settings - Fork 51
/
NewApps.cs
80 lines (72 loc) · 2.4 KB
/
NewApps.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace AndroidSideloader
{
public partial class NewApps : Form
{
private bool mouseDown;
private Point lastLocation;
public NewApps()
{
InitializeComponent();
}
private void label2_MouseDown(object sender, MouseEventArgs e)
{
mouseDown = true;
lastLocation = e.Location;
}
private void label2_MouseMove(object sender, MouseEventArgs e)
{
if (mouseDown)
{
Location = new Point(
Location.X - lastLocation.X + e.X, Location.Y - lastLocation.Y + e.Y);
Update();
}
}
private void label2_MouseUp(object sender, MouseEventArgs e)
{
mouseDown = false;
}
private void DonateButton_Click(object sender, EventArgs e)
{
string HWID = SideloaderUtilities.UUID();
foreach (ListViewItem listItem in NewAppsListView.Items)
{
if (listItem.Checked)
{
Properties.Settings.Default.NonAppPackages += listItem.SubItems[Donors.PackageNameIndex].Text + ";" + HWID + "\n";
Properties.Settings.Default.Save();
}
else
{
Properties.Settings.Default.AppPackages += listItem.SubItems[Donors.PackageNameIndex].Text + "\n";
Properties.Settings.Default.Save();
}
}
MainForm.newPackageUpload();
Close();
}
private void NewApps_Load(object sender, EventArgs e)
{
NewAppsListView.Items.Clear();
Donors.initNewApps();
List<ListViewItem> NewAppList = new List<ListViewItem>();
foreach (string[] release in Donors.newApps)
{
ListViewItem NGame = new ListViewItem(release);
if (!NewAppList.Contains(NGame))
{
NewAppList.Add(NGame);
}
}
ListViewItem[] arr = NewAppList.ToArray();
NewAppsListView.BeginUpdate();
NewAppsListView.Items.Clear();
NewAppsListView.Items.AddRange(arr);
NewAppsListView.EndUpdate();
}
}
}