-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditWindow.cs
40 lines (35 loc) · 1.13 KB
/
EditWindow.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace JSONExtension
{
public partial class EditWindow : Form
{
public EditWindow(string key, string value, bool createNew = false)
{
InitializeComponent();
prevkeyText.Text = key;
newKeyText.Text = key;
prevValueText.Text = value;
newValueText.Text = value;
this.Cursor = new Cursor(Cursor.Current.Handle);
this.Location = Cursor.Position; //move window to the cursor location
newValueText.Select(0, 0); //move cursor to first char of textbox
if (createNew)
{
this.Text = "JSONEx Create Window";
}
}
private void AcceptButton_Click(object sender, EventArgs e)
{
JSONExtensionPackage.settings.EditEntry(prevkeyText.Text, newKeyText.Text, prevValueText.Text, newValueText.Text);
Dispose();
}
}
}