forked from thedeemon/gep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RenderURLForm.cs
61 lines (56 loc) · 1.77 KB
/
RenderURLForm.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
namespace gep
{
public partial class RenderURLForm : Form
{
public RenderURLForm(string caption)
{
InitializeComponent();
Text = caption;
}
private void OnCancel(object sender, EventArgs e)
{
Close();
}
private void OnOK(object sender, EventArgs e)
{
string cur_url = comboURL.Text;
url_list.Remove(cur_url);
url_list.Insert(0, cur_url);
int k = Math.Min(url_list.Count, 10);
using (RegistryKey rk = Registry.CurrentUser.OpenSubKey(keyname, true))
{
for (int i = 0; i < k; i++)
{
string url_name = "url" + i.ToString();
rk.SetValue(url_name, url_list[i]);
}
}
selectedURL = cur_url;
Close();
}
List<string> url_list = new List<string>();
string keyname = @"Software\Infognition\GraphEditPlus";
public string selectedURL;
private void RenderURLForm_Load(object sender, EventArgs e)
{
using (RegistryKey rk = Registry.CurrentUser.OpenSubKey(keyname))
{
for (int i = 0; i < 10; i++)
{
string url_name = "url" + i.ToString();
string url = (string)rk.GetValue(url_name, "");
url_list.Add(url);
comboURL.Items.Add(url);
}
}
}
}
}