forked from ispysoftware/iSpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GridViewManager.cs
106 lines (93 loc) · 2.9 KB
/
GridViewManager.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using iSpyApplication.Controls;
namespace iSpyApplication
{
public partial class GridViewManager : Form
{
public MainForm MainClass;
public GridViewManager()
{
InitializeComponent();
RenderResources();
}
private void RenderResources()
{
Text = LocRm.GetString("GridViewManager");
LocRm.SetString(button3,"Edit");
LocRm.SetString(button2, "Delete");
LocRm.SetString(button1, "New");
}
private void GridViewManager_Load(object sender, EventArgs e)
{
LoadGrids();
}
private void LoadGrids()
{
lbGridViews.Items.Clear();
foreach (configurationGrid gv in MainForm.Conf.GridViews)
{
lbGridViews.Items.Add(gv.name);
}
}
private void button1_Click(object sender, EventArgs e)
{
AddGridView();
LoadGrids();
}
private void AddGridView()
{
var gvc = new GridViewCustom();
gvc.ShowDialog(this);
if (gvc.DialogResult == DialogResult.OK)
{
var cg = new configurationGrid
{
Columns = gvc.Cols,
Rows = gvc.Rows,
name = gvc.GridName,
FullScreen = gvc.FullScreen,
AlwaysOnTop = gvc.AlwaysOnTop,
Display = gvc.Display,
Framerate = gvc.Framerate,
ModeIndex = gvc.Mode,
Fill = gvc.Fill,
ModeConfig = gvc.ModeConfig,
ShowAtStartup = gvc.ShowAtStartup,
GridItem = new configurationGridGridItem[] { }
};
List<configurationGrid> l = MainForm.Conf.GridViews.ToList();
l.Add(cg);
MainForm.Conf.GridViews = l.ToArray();
MainClass.ShowGridView(cg.name);
LoadGrids();
}
gvc.Dispose();
}
private void button2_Click(object sender, EventArgs e)
{
var l = MainForm.Conf.GridViews.ToList();
foreach (var s in lbGridViews.SelectedItems)
{
l.RemoveAll(p => p.name == s.ToString());
}
MainForm.Conf.GridViews = l.ToArray();
LoadGrids();
}
private void button3_Click(object sender, EventArgs e)
{
foreach (var s in lbGridViews.SelectedItems)
{
MainClass.EditGridView(s.ToString(),this);
LoadGrids();
break;
}
}
}
}