@@ -19,10 +19,10 @@ public class DfAdditionalDiv : AutoContext<DfAdditionalDiv>
19
19
20
20
public DfAdditionalDiv ( )
21
21
{
22
- Name = "d" + Path . GetRandomFileName ( ) . Replace ( "." , "" ) ;
23
- string strFunc = "createElement(\u0022 " + "aside" + "\u0022 , \u0022 " + Name + "\u0022 )" ;
22
+ ItemKey = "d" + Path . GetRandomFileName ( ) . Replace ( "." , "" ) ;
23
+ string strFunc = "createElement(\u0022 " + "aside" + "\u0022 , \u0022 " + ItemKey + "\u0022 )" ;
24
24
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
25
- DeclarativeForms . AddToHashtable ( Name , this ) ;
25
+ DeclarativeForms . AddToHashtable ( ItemKey , this ) ;
26
26
style = new DfStyle ( ) ;
27
27
style . Owner = this ;
28
28
}
@@ -41,7 +41,7 @@ public int ScrollTop
41
41
{
42
42
scrollTop = value ;
43
43
//setProperty(nameElement, nameProperty, valueProperty)
44
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "scrollTop" + "\u0022 , \u0022 " + scrollTop + "\u0022 )" ;
44
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "scrollTop" + "\u0022 , \u0022 " + scrollTop + "\u0022 )" ;
45
45
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
46
46
}
47
47
}
@@ -55,7 +55,7 @@ public int ScrollLeft
55
55
{
56
56
scrollLeft = value ;
57
57
//setProperty(nameElement, nameProperty, valueProperty)
58
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "scrollLeft" + "\u0022 , \u0022 " + scrollLeft + "\u0022 )" ;
58
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "scrollLeft" + "\u0022 , \u0022 " + scrollLeft + "\u0022 )" ;
59
59
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
60
60
}
61
61
}
@@ -69,7 +69,7 @@ public string Id
69
69
{
70
70
id = value ;
71
71
//setProperty(nameElement, nameProperty, valueProperty)
72
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "id" + "\u0022 , \u0022 " + id + "\u0022 )" ;
72
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "id" + "\u0022 , \u0022 " + id + "\u0022 )" ;
73
73
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
74
74
}
75
75
}
@@ -79,19 +79,11 @@ public string Id
79
79
public string Name
80
80
{
81
81
get { return name ; }
82
- set { name = value ; }
83
- }
84
-
85
- private string className ;
86
- [ ContextProperty ( "ИмяКласса" , "ClassName" ) ]
87
- public string ClassName
88
- {
89
- get { return className ; }
90
82
set
91
83
{
92
- className = value ;
84
+ name = value ;
93
85
//setProperty(nameElement, nameProperty, valueProperty)
94
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "className " + "\u0022 , \u0022 " + className + "\u0022 )" ;
86
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "name " + "\u0022 , \u0022 " + name + "\u0022 )" ;
95
87
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
96
88
}
97
89
}
@@ -105,11 +97,33 @@ public string AccessKey
105
97
{
106
98
accessKey = value ;
107
99
//setProperty(nameElement, nameProperty, valueProperty)
108
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "accessKey" + "\u0022 , \u0022 " + accessKey + "\u0022 )" ;
100
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "accessKey" + "\u0022 , \u0022 " + accessKey + "\u0022 )" ;
101
+ DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
102
+ }
103
+ }
104
+
105
+ private string _class ;
106
+ [ ContextProperty ( "Класс" , "Class" ) ]
107
+ public string Class
108
+ {
109
+ get { return _class ; }
110
+ set
111
+ {
112
+ _class = value ;
113
+ //setProperty(nameElement, nameProperty, valueProperty)
114
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "className" + "\u0022 , \u0022 " + _class + "\u0022 )" ;
109
115
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
110
116
}
111
117
}
112
118
119
+ private string itemKey ;
120
+ [ ContextProperty ( "КлючЭлемента" , "ItemKey" ) ]
121
+ public string ItemKey
122
+ {
123
+ get { return itemKey ; }
124
+ set { itemKey = value ; }
125
+ }
126
+
113
127
private string dir ;
114
128
[ ContextProperty ( "Направление" , "Dir" ) ]
115
129
public string Dir
@@ -119,7 +133,7 @@ public string Dir
119
133
{
120
134
dir = value ;
121
135
//setProperty(nameElement, nameProperty, valueProperty)
122
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "dir" + "\u0022 , \u0022 " + dir + "\u0022 )" ;
136
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "dir" + "\u0022 , \u0022 " + dir + "\u0022 )" ;
123
137
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
124
138
}
125
139
}
@@ -133,7 +147,7 @@ public int TabIndex
133
147
{
134
148
tabIndex = value ;
135
149
//setProperty(nameElement, nameProperty, valueProperty)
136
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "tabIndex" + "\u0022 , \u0022 " + tabIndex + "\u0022 )" ;
150
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "tabIndex" + "\u0022 , \u0022 " + tabIndex + "\u0022 )" ;
137
151
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
138
152
}
139
153
}
@@ -147,7 +161,7 @@ public bool ContentEditable
147
161
{
148
162
contentEditable = value ;
149
163
//setProperty(nameElement, nameProperty, valueProperty)
150
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "contentEditable" + "\u0022 , \u0022 " + contentEditable . ToString ( ) . ToLower ( ) + "\u0022 )" ;
164
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "contentEditable" + "\u0022 , \u0022 " + contentEditable . ToString ( ) . ToLower ( ) + "\u0022 )" ;
151
165
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
152
166
}
153
167
}
@@ -161,7 +175,7 @@ public IValue Parent
161
175
{
162
176
parent = value ;
163
177
//setParent(nameElement, nameparent)
164
- string strFunc = "setParent(\u0022 " + Name + "\u0022 , \u0022 " + parent . AsObject ( ) . GetPropValue ( "Name " ) + "\u0022 )" ;
178
+ string strFunc = "setParent(\u0022 " + ItemKey + "\u0022 , \u0022 " + parent . AsObject ( ) . GetPropValue ( "ItemKey " ) + "\u0022 )" ;
165
179
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
166
180
// Родителю добавим потомка.
167
181
ArrayImpl ArrayImpl1 = ( ( dynamic ) parent ) . Children ;
@@ -192,7 +206,7 @@ public IValue Text
192
206
str = str . Replace ( "\u000A " , @"\u000A" ) ; // Перевод строки
193
207
str = str . Replace ( "\u007C " , @"\u007C" ) ; // Знак |
194
208
str = str . Replace ( "\u0022 " , @"\u0022" ) ; // Кавычки.
195
- string strFunc = "setProperty(\u0022 " + Name + "\u0022 , \u0022 " + "innerText" + "\u0022 , \u0022 " + str + "\u0022 )" ;
209
+ string strFunc = "setProperty(\u0022 " + ItemKey + "\u0022 , \u0022 " + "innerText" + "\u0022 , \u0022 " + str + "\u0022 )" ;
196
210
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
197
211
}
198
212
}
@@ -212,8 +226,8 @@ public DfAction DoubleClick
212
226
set
213
227
{
214
228
dblclick = value ;
215
- //map .get(nameElement).addEventListener(nameEvent, doEvent);
216
- string strFunc = "map .get(\u0022 " + Name + "\u0022 ).addEventListener(\u0022 dblclick\u0022 , doEvent);" ;
229
+ //mapKeyEl .get(nameElement).addEventListener(nameEvent, doEvent);
230
+ string strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 dblclick\u0022 , doEvent);" ;
217
231
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
218
232
}
219
233
}
@@ -226,8 +240,8 @@ public DfAction Click
226
240
set
227
241
{
228
242
click = value ;
229
- //map .get(nameElement).addEventListener(nameEvent, doEvent);
230
- string strFunc = "map .get(\u0022 " + Name + "\u0022 ).addEventListener(\u0022 click\u0022 , doEvent);" ;
243
+ //mapKeyEl .get(nameElement).addEventListener(nameEvent, doEvent);
244
+ string strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 click\u0022 , doEvent);" ;
231
245
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
232
246
}
233
247
}
@@ -240,16 +254,16 @@ public DfAction MouseUp
240
254
set
241
255
{
242
256
mouseup = value ;
243
- //map .get(nameElement).addEventListener(nameEvent, doEvent);
244
- string strFunc = "map .get(\u0022 " + Name + "\u0022 ).addEventListener(\u0022 mouseup\u0022 , doEvent);" ;
257
+ //mapKeyEl .get(nameElement).addEventListener(nameEvent, doEvent);
258
+ string strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).addEventListener(\u0022 mouseup\u0022 , doEvent);" ;
245
259
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
246
260
}
247
261
}
248
262
249
263
[ ContextMethod ( "ДобавитьДочерний" , "АppendChild" ) ]
250
264
public IValue АppendChild ( IValue p1 )
251
265
{
252
- string strFunc = "map .get(\u0022 " + Name + "\u0022 ).appendChild(map .get(\u0022 " + ( ( dynamic ) p1 ) . Name + "\u0022 ));" ;
266
+ string strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).appendChild(mapKeyEl .get(\u0022 " + ( ( dynamic ) p1 ) . ItemKey + "\u0022 ));" ;
253
267
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
254
268
( ( dynamic ) p1 ) . Parent = this ;
255
269
return p1 ;
@@ -261,43 +275,43 @@ public void ScrollIntoView(bool p1 = true)
261
275
string strFunc ;
262
276
if ( ! p1 )
263
277
{
264
- strFunc = "map .get(\u0022 " + Name + "\u0022 ).scrollIntoView(false);" ;
278
+ strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).scrollIntoView(false);" ;
265
279
}
266
280
else
267
281
{
268
- strFunc = "map .get(\u0022 " + Name + "\u0022 ).scrollIntoView();" ;
282
+ strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).scrollIntoView();" ;
269
283
}
270
284
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
271
285
}
272
286
273
287
[ ContextMethod ( "СнятьФокус" , "Blur" ) ]
274
288
public void Blur ( )
275
289
{
276
- //map .get(nameElement).blur();
277
- string strFunc = "map .get(\u0022 " + Name + "\u0022 ).blur();" ;
290
+ //mapKeyEl .get(nameElement).blur();
291
+ string strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).blur();" ;
278
292
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
279
293
}
280
294
281
295
[ ContextMethod ( "Удалить" , "Remove" ) ]
282
296
public void Remove ( )
283
297
{
284
- //map .get(nameElement).remove();
285
- string strFunc = "map .get(\u0022 " + Name + "\u0022 ).remove();" ;
298
+ //mapKeyEl .get(nameElement).remove();
299
+ string strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).remove();" ;
286
300
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
287
301
}
288
302
289
303
[ ContextMethod ( "УдалитьДочерний" , "RemoveChild" ) ]
290
304
public void RemoveChild ( IValue p1 )
291
305
{
292
- string strFunc = "map .get(\u0022 " + Name + "\u0022 ).removeChild(map .get(\u0022 " + ( ( dynamic ) p1 . AsObject ( ) ) . Name + "\u0022 ));" ;
306
+ string strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).removeChild(mapKeyEl .get(\u0022 " + ( ( dynamic ) p1 . AsObject ( ) ) . ItemKey + "\u0022 ));" ;
293
307
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
294
308
}
295
309
296
310
[ ContextMethod ( "Фокус" , "Focus" ) ]
297
311
public void Focus ( )
298
312
{
299
- //map .get(nameElement).focus();
300
- string strFunc = "map .get(\u0022 " + Name + "\u0022 ).focus();" ;
313
+ //mapKeyEl .get(nameElement).focus();
314
+ string strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).focus();" ;
301
315
DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
302
316
}
303
317
0 commit comments