-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathT_ClosenessPage.cs
109 lines (91 loc) · 3.64 KB
/
T_ClosenessPage.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace DataArmor
{
public partial class t_closeness : Form
{
public DataTable dataTable = new DataTable();
public DataTable M=new DataTable();
public List<string> SA = new List<string>();
double T;
public List<string> QID = new List<string>();
public t_closeness(DataTable dt, List<string> qid, List<string>sa)
{
InitializeComponent();
dataTable=dt;
SA=sa;
QID=qid;
}
private void t_closeness_Load(object sender, EventArgs e)
{
}
private void DataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
dataGridView10.Columns[e.ColumnIndex].Width = 170; }
private void ok2_btn_Click(object sender, EventArgs e)
{
if (double.TryParse(T_val.Text,out T))
{
if (T > 0 & T < 1)
{
T_closeness_code d = new T_closeness_code(dataTable, T, SA, QID);
M = d.dataTable;
dataGridView10.Visible = true;
dataGridView10.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridView10.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridView10.RowHeadersDefaultCellStyle.Font = new Font("Times New Roman", 15, FontStyle.Bold);
dataGridView10.RowHeadersDefaultCellStyle.ForeColor = Color.White;
dataGridView10.RowHeadersDefaultCellStyle.BackColor = Color.Black;
dataGridView10.Font = new Font("Times New Roman", 12, FontStyle.Bold);
dataGridView10.DefaultCellStyle.ForeColor = Color.Black;
dataGridView10.CellFormatting += DataGridView1_CellFormatting;
dataGridView10.BorderStyle = BorderStyle.FixedSingle;
dataGridView10.DataSource = M;
dataGridView10.Visible = true;
}
else
{
MessageBox.Show("Please Enter Valid T value \n\"T must be in the range of 0 to 1.\"", "Error");
}
}
else
{
MessageBox.Show("Please Enter Valid T value \n\"T must be number in the range of 0 to 1.\"", "Error");
}
}
private void save_btn_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.CheckFileExists = false;
saveFileDialog1.Title = "Save Anonymized CSV File";
saveFileDialog1.ShowDialog();
string s = saveFileDialog1.FileName;
if (s != "")
{
K_AnonymityPage.to_csv(M, s);
}
}
private void dataGridView10_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
if (ClassificationPage.EID.Count == 0)
{
MessageBox.Show("Must Add Explicit IDs! (Go back to classification page)");
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void pictureBox8_Click(object sender, EventArgs e)
{
}
}
}