1
1
using OpenLocoTool ;
2
- using System ;
3
- using System . Collections . Generic ;
4
2
using System . ComponentModel ;
5
- using System . Data ;
6
- using System . Drawing ;
7
- using System . Drawing . Design ;
8
- using System . Linq ;
9
- using System . Text ;
10
- using System . Threading . Tasks ;
11
- using System . Windows . Forms ;
12
- using System . Windows . Forms . Design ;
13
3
14
4
namespace OpenLocoToolGui
15
5
{
16
6
public partial class StringTableUserControl : UserControl
17
7
{
18
8
private BindingList < string > blKeys = new BindingList < string > ( ) ;
19
- //Dictionary<string, Dictionary<LanguageId, string>> boundData;
20
9
21
10
public StringTableUserControl ( )
22
11
{
23
12
InitializeComponent ( ) ;
24
-
25
- // Set up data binding for the inner dictionary DataGridView.
26
- //dgvLanguageSelector.DataSource = innerDataBindingList;
27
13
}
28
14
29
15
public void SetDataBinding ( Dictionary < string , Dictionary < LanguageId , string > > data )
30
16
{
31
- //boundData = data;
32
-
33
17
blKeys . Clear ( ) ;
34
18
foreach ( var key in data . Keys )
35
19
{
@@ -49,53 +33,4 @@ public void SetDataBinding(Dictionary<string, Dictionary<LanguageId, string>> da
49
33
} ;
50
34
}
51
35
}
52
-
53
- //public class MyPropertyTypeConverter : TypeConverter
54
- //{
55
- // public override bool GetPropertiesSupported(ITypeDescriptorContext context)
56
- // {
57
- // return true;
58
- // }
59
-
60
- // public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
61
- // {
62
- // // Return the PropertyDescriptors for the properties of your custom UserControl.
63
- // // You can create custom PropertyDescriptors if needed.
64
- // return TypeDescriptor.GetProperties(value, attributes);
65
- // }
66
- //}
67
-
68
-
69
- //public class MyPropertyUIEditor : UITypeEditor
70
- //{
71
- // public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
72
- // {
73
- // return UITypeEditorEditStyle.Modal;
74
- // }
75
-
76
- // public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
77
- // {
78
- // if (provider != null)
79
- // {
80
- // IWindowsFormsEditorService editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
81
-
82
- // if (editorService != null)
83
- // {
84
- // // Create an instance of your custom UserControl.
85
- // StringTableUserControl userControl = new StringTableUserControl();
86
- // // Set its value based on the current property value.
87
- // userControl.PropertyValue = (YourPropertyType)value;
88
-
89
- // // Show your UserControl in a dialog.
90
- // editorService.ShowDialog(userControl);
91
-
92
- // // Return the updated value from your UserControl.
93
- // return userControl.PropertyValue;
94
- // }
95
- // }
96
-
97
- // return base.EditValue(context, provider, value);
98
- // }
99
- //}
100
-
101
36
}
0 commit comments