@@ -19,10 +19,10 @@ public class DfAdditionalDiv : AutoContext<DfAdditionalDiv>
1919
2020 public DfAdditionalDiv ( )
2121 {
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 )" ;
2424 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
25- DeclarativeForms . AddToHashtable ( Name , this ) ;
25+ DeclarativeForms . AddToHashtable ( ItemKey , this ) ;
2626 style = new DfStyle ( ) ;
2727 style . Owner = this ;
2828 }
@@ -41,7 +41,7 @@ public int ScrollTop
4141 {
4242 scrollTop = value ;
4343 //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 )" ;
4545 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
4646 }
4747 }
@@ -55,7 +55,7 @@ public int ScrollLeft
5555 {
5656 scrollLeft = value ;
5757 //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 )" ;
5959 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
6060 }
6161 }
@@ -69,7 +69,7 @@ public string Id
6969 {
7070 id = value ;
7171 //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 )" ;
7373 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
7474 }
7575 }
@@ -79,19 +79,11 @@ public string Id
7979 public string Name
8080 {
8181 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 ; }
9082 set
9183 {
92- className = value ;
84+ name = value ;
9385 //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 )" ;
9587 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
9688 }
9789 }
@@ -105,11 +97,33 @@ public string AccessKey
10597 {
10698 accessKey = value ;
10799 //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 )" ;
109115 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
110116 }
111117 }
112118
119+ private string itemKey ;
120+ [ ContextProperty ( "КлючЭлемента" , "ItemKey" ) ]
121+ public string ItemKey
122+ {
123+ get { return itemKey ; }
124+ set { itemKey = value ; }
125+ }
126+
113127 private string dir ;
114128 [ ContextProperty ( "Направление" , "Dir" ) ]
115129 public string Dir
@@ -119,7 +133,7 @@ public string Dir
119133 {
120134 dir = value ;
121135 //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 )" ;
123137 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
124138 }
125139 }
@@ -133,7 +147,7 @@ public int TabIndex
133147 {
134148 tabIndex = value ;
135149 //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 )" ;
137151 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
138152 }
139153 }
@@ -147,7 +161,7 @@ public bool ContentEditable
147161 {
148162 contentEditable = value ;
149163 //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 )" ;
151165 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
152166 }
153167 }
@@ -161,7 +175,7 @@ public IValue Parent
161175 {
162176 parent = value ;
163177 //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 )" ;
165179 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
166180 // Родителю добавим потомка.
167181 ArrayImpl ArrayImpl1 = ( ( dynamic ) parent ) . Children ;
@@ -192,7 +206,7 @@ public IValue Text
192206 str = str . Replace ( "\u000A " , @"\u000A" ) ; // Перевод строки
193207 str = str . Replace ( "\u007C " , @"\u007C" ) ; // Знак |
194208 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 )" ;
196210 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
197211 }
198212 }
@@ -212,8 +226,8 @@ public DfAction DoubleClick
212226 set
213227 {
214228 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);" ;
217231 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
218232 }
219233 }
@@ -226,8 +240,8 @@ public DfAction Click
226240 set
227241 {
228242 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);" ;
231245 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
232246 }
233247 }
@@ -240,16 +254,16 @@ public DfAction MouseUp
240254 set
241255 {
242256 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);" ;
245259 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
246260 }
247261 }
248262
249263 [ ContextMethod ( "ДобавитьДочерний" , "АppendChild" ) ]
250264 public IValue АppendChild ( IValue p1 )
251265 {
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 ));" ;
253267 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
254268 ( ( dynamic ) p1 ) . Parent = this ;
255269 return p1 ;
@@ -261,43 +275,43 @@ public void ScrollIntoView(bool p1 = true)
261275 string strFunc ;
262276 if ( ! p1 )
263277 {
264- strFunc = "map .get(\u0022 " + Name + "\u0022 ).scrollIntoView(false);" ;
278+ strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).scrollIntoView(false);" ;
265279 }
266280 else
267281 {
268- strFunc = "map .get(\u0022 " + Name + "\u0022 ).scrollIntoView();" ;
282+ strFunc = "mapKeyEl .get(\u0022 " + ItemKey + "\u0022 ).scrollIntoView();" ;
269283 }
270284 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
271285 }
272286
273287 [ ContextMethod ( "СнятьФокус" , "Blur" ) ]
274288 public void Blur ( )
275289 {
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();" ;
278292 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
279293 }
280294
281295 [ ContextMethod ( "Удалить" , "Remove" ) ]
282296 public void Remove ( )
283297 {
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();" ;
286300 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
287301 }
288302
289303 [ ContextMethod ( "УдалитьДочерний" , "RemoveChild" ) ]
290304 public void RemoveChild ( IValue p1 )
291305 {
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 ));" ;
293307 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
294308 }
295309
296310 [ ContextMethod ( "Фокус" , "Focus" ) ]
297311 public void Focus ( )
298312 {
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();" ;
301315 DeclarativeForms . strFunctions = DeclarativeForms . strFunctions + strFunc + ";" ;
302316 }
303317
0 commit comments