@@ -15,66 +15,66 @@ This Source Code Form is subject to the terms of the
1515
1616namespace OneScript . Web . Server
1717{
18- [ ContextClass ( "Форма" , "Form" ) ]
19- public class FormCollectionWrapper : AutoCollectionContext < FormCollectionWrapper , KeyAndValueImpl >
20- {
21- private readonly IFormCollection _items ;
18+ [ ContextClass ( "Форма" , "Form" ) ]
19+ public class FormCollectionWrapper : AutoCollectionContext < FormCollectionWrapper , KeyAndValueImpl >
20+ {
21+ private readonly IFormCollection _items ;
2222
23- internal FormCollectionWrapper ( IFormCollection headers )
24- {
25- _items = headers ;
26- }
23+ internal FormCollectionWrapper ( IFormCollection headers )
24+ {
25+ _items = headers ;
26+ }
2727
2828 public override bool IsIndexed => true ;
2929
30- public override StringValuesWrapper GetIndexedValue ( IValue index )
31- {
32- if ( _items . TryGetValue ( index . AsString ( ) , out var result ) )
33- return result ;
34- else
35- return StringValues . Empty ;
36- }
30+ public override StringValuesWrapper GetIndexedValue ( IValue index )
31+ {
32+ if ( _items . TryGetValue ( index . AsString ( ) , out var result ) )
33+ return result ;
34+ else
35+ return StringValues . Empty ;
36+ }
3737
38- internal bool ContainsKey ( IValue key )
39- {
40- return _items . ContainsKey ( key . AsString ( ) ) ;
41- }
38+ internal bool ContainsKey ( IValue key )
39+ {
40+ return _items . ContainsKey ( key . AsString ( ) ) ;
41+ }
4242
43- public IEnumerable < IValue > Keys ( )
44- {
45- foreach ( var key in _items . Keys )
46- yield return ValueFactory . Create ( key ) ;
47- }
43+ public IEnumerable < IValue > Keys ( )
44+ {
45+ foreach ( var key in _items . Keys )
46+ yield return ValueFactory . Create ( key ) ;
47+ }
4848
49- #region ICollectionContext Members
49+ #region ICollectionContext Members
5050
51- [ ContextMethod ( "Получить" , "Get" ) ]
52- public StringValuesWrapper Retrieve ( IValue key )
53- {
54- return GetIndexedValue ( key ) ;
55- }
51+ [ ContextMethod ( "Получить" , "Get" ) ]
52+ public StringValuesWrapper Retrieve ( IValue key )
53+ {
54+ return GetIndexedValue ( key ) ;
55+ }
5656
57- [ ContextMethod ( "Количество" , "Count" ) ]
58- public override int Count ( )
59- {
60- return _items . Count ;
61- }
57+ [ ContextMethod ( "Количество" , "Count" ) ]
58+ public override int Count ( )
59+ {
60+ return _items . Count ;
61+ }
6262
63- #endregion
63+ #endregion
6464
65- #region IEnumerable<IValue> Members
65+ #region IEnumerable<IValue> Members
6666
67- public override IEnumerator < KeyAndValueImpl > GetEnumerator ( )
68- {
69- foreach ( var item in _items )
70- {
71- yield return new KeyAndValueImpl ( ValueFactory . Create ( item . Key ) , ( StringValuesWrapper ) item . Value ) ;
72- }
73- }
67+ public override IEnumerator < KeyAndValueImpl > GetEnumerator ( )
68+ {
69+ foreach ( var item in _items )
70+ {
71+ yield return new KeyAndValueImpl ( ValueFactory . Create ( item . Key ) , ( StringValuesWrapper ) item . Value ) ;
72+ }
73+ }
7474
75- #endregion
75+ #endregion
7676
77- [ ContextProperty ( "Файлы" , "Files" , CanWrite = false ) ]
78- public FormFileCollectionWrapper Files => new ( _items . Files ) ;
79- }
77+ [ ContextProperty ( "Файлы" , "Files" , CanWrite = false ) ]
78+ public FormFileCollectionWrapper Files => new ( _items . Files ) ;
79+ }
8080}
0 commit comments