@@ -141,20 +141,23 @@ private static bool MethodExistsForObject(IRuntimeContextInstance target, string
141141 }
142142 }
143143
144+
145+ private const int annotNameColumnIndex = 0 ;
146+ private const int annotParamsColumnIndex = 1 ;
144147 private static ValueTable EmptyAnnotationsTable ( )
145148 {
146149 var annotationsTable = new ValueTable ( ) ;
147- annotationsTable . Columns . Add ( "Имя" ) ;
148- annotationsTable . Columns . Add ( "Параметры" ) ;
150+ annotationsTable . Columns . AddUnchecked ( "Имя" , "Имя" ) ;
151+ annotationsTable . Columns . AddUnchecked ( "Параметры" , "Параметры" ) ;
149152
150153 return annotationsTable ;
151154 }
152155
153156 private static ValueTable CreateAnnotationTable ( BslAnnotationAttribute [ ] annotations )
154157 {
155158 var annotationsTable = EmptyAnnotationsTable ( ) ;
156- var annotationNameColumn = annotationsTable . Columns . FindColumnByName ( "Имя" ) ;
157- var annotationParamsColumn = annotationsTable . Columns . FindColumnByName ( "Параметры" ) ;
159+ var annotationNameColumn = annotationsTable . Columns . FindColumnByIndex ( annotNameColumnIndex ) ;
160+ var annotationParamsColumn = annotationsTable . Columns . FindColumnByIndex ( annotParamsColumnIndex ) ;
158161
159162 foreach ( var annotation in annotations )
160163 {
@@ -185,10 +188,11 @@ private static ValueTable FillAnnotationParameters(IEnumerable<BslAnnotationPara
185188 }
186189 if ( annotationParameter . Value is BslAnnotationValue annotationValue )
187190 {
188- var expandedValue = EmptyAnnotationsTable ( ) ;
191+ var expandedValue = EmptyAnnotationsTable ( ) ;
192+ var expandedValueColumns = expandedValue . Columns ;
189193 var row = expandedValue . Add ( ) ;
190- row . Set ( expandedValue . Columns . FindColumnByName ( "Имя" ) , ValueFactory . Create ( annotationValue . Name ) ) ;
191- row . Set ( expandedValue . Columns . FindColumnByName ( "Параметры" ) , FillAnnotationParameters ( annotationValue . Parameters ) ) ;
194+ row . Set ( expandedValueColumns . FindColumnByIndex ( annotNameColumnIndex ) , ValueFactory . Create ( annotationValue . Name ) ) ;
195+ row . Set ( expandedValueColumns . FindColumnByIndex ( annotParamsColumnIndex ) , FillAnnotationParameters ( annotationValue . Parameters ) ) ;
192196 parameterRow . Set ( parameterValueColumn , row ) ;
193197 }
194198 else
@@ -344,12 +348,12 @@ private static void FillPropertiesTableForType(BslTypeValue type, ValueTable res
344348
345349 private static void FillMethodsTable ( ValueTable result , IEnumerable < BslMethodInfo > methods )
346350 {
347- var nameColumn = result . Columns . Add ( "Имя" , TypeDescription . StringType ( ) , "Имя" ) ;
348- var countColumn = result . Columns . Add ( "КоличествоПараметров" , TypeDescription . IntegerType ( ) , "Количество параметров" ) ;
349- var isFunctionColumn = result . Columns . Add ( "ЭтоФункция" , TypeDescription . BooleanType ( ) , "Это функция" ) ;
350- var annotationsColumn = result . Columns . Add ( "Аннотации" , new TypeDescription ( ) , "Аннотации" ) ;
351- var paramsColumn = result . Columns . Add ( "Параметры" , new TypeDescription ( ) , "Параметры" ) ;
352- var isExportlColumn = result . Columns . Add ( "Экспорт" , TypeDescription . BooleanType ( ) , "Экспорт" ) ;
351+ var nameColumn = result . Columns . AddUnchecked ( "Имя" , "Имя" , TypeDescription . StringType ( ) ) ;
352+ var countColumn = result . Columns . AddUnchecked ( "КоличествоПараметров" , "Количество параметров" , TypeDescription . IntegerType ( ) ) ;
353+ var isFunctionColumn = result . Columns . AddUnchecked ( "ЭтоФункция" , "Это функция" , TypeDescription . BooleanType ( ) ) ;
354+ var annotationsColumn = result . Columns . AddUnchecked ( "Аннотации" , "Аннотации" ) ;
355+ var paramsColumn = result . Columns . AddUnchecked ( "Параметры" , "Параметры" ) ;
356+ var isExportlColumn = result . Columns . AddUnchecked ( "Экспорт" , "Экспорт" , TypeDescription . BooleanType ( ) ) ;
353357
354358 foreach ( var methInfo in methods )
355359 {
@@ -365,12 +369,11 @@ private static void FillMethodsTable(ValueTable result, IEnumerable<BslMethodInf
365369 new_row . Set ( annotationsColumn , CreateAnnotationTable ( annotations ) ) ;
366370
367371 var paramTable = new ValueTable ( ) ;
368- var paramNameColumn = paramTable . Columns . Add ( "Имя" , TypeDescription . StringType ( ) , "Имя" ) ;
369- var paramByValue = paramTable . Columns . Add ( "ПоЗначению" , TypeDescription . BooleanType ( ) , "По значению" ) ;
370- var paramHasDefaultValue = paramTable . Columns . Add ( "ЕстьЗначениеПоУмолчанию" , TypeDescription . BooleanType ( ) , "Есть значение по-умолчанию" ) ;
371- var paramDefaultValue = paramTable . Columns . Add ( "ЗначениеПоУмолчанию" , new TypeDescription ( ) , "Значение по умолчанию" ) ;
372- var paramAnnotationsColumn = paramTable . Columns . Add ( "Аннотации" , new TypeDescription ( ) , "Аннотации" ) ;
373-
372+ var paramNameColumn = paramTable . Columns . AddUnchecked ( "Имя" , "Имя" , TypeDescription . StringType ( ) ) ;
373+ var paramByValue = paramTable . Columns . AddUnchecked ( "ПоЗначению" , "По значению" , TypeDescription . BooleanType ( ) ) ;
374+ var paramHasDefaultValue = paramTable . Columns . AddUnchecked ( "ЕстьЗначениеПоУмолчанию" , "Есть значение по-умолчанию" , TypeDescription . BooleanType ( ) ) ;
375+ var paramDefaultValue = paramTable . Columns . AddUnchecked ( "ЗначениеПоУмолчанию" , "Значение по умолчанию" ) ;
376+ var paramAnnotationsColumn = paramTable . Columns . AddUnchecked ( "Аннотации" , "Аннотации" ) ;
374377 new_row . Set ( paramsColumn , paramTable ) ;
375378
376379 if ( parameters . Length != 0 )
@@ -454,9 +457,9 @@ public void SetProperty(IRuntimeContextInstance target, string prop, IValue valu
454457
455458 private static void FillPropertiesTable ( ValueTable result , IEnumerable < BslPropertyInfo > properties )
456459 {
457- var nameColumn = result . Columns . Add ( "Имя" , TypeDescription . StringType ( ) , "Имя" ) ;
458- var annotationsColumn = result . Columns . Add ( "Аннотации" , new TypeDescription ( ) , "Аннотации" ) ;
459- var isExportedColumn = result . Columns . Add ( "Экспорт" , TypeDescription . BooleanType ( ) , "Экспорт" ) ;
460+ var nameColumn = result . Columns . AddUnchecked ( "Имя" , "Имя" , TypeDescription . StringType ( ) ) ;
461+ var annotationsColumn = result . Columns . AddUnchecked ( "Аннотации" , "Аннотации" ) ;
462+ var isExportedColumn = result . Columns . AddUnchecked ( "Экспорт" , "Экспорт" , TypeDescription . BooleanType ( ) ) ;
460463
461464 var systemVarNames = new string [ ] { "этотобъект" , "thisobject" } ;
462465
@@ -532,11 +535,11 @@ public ValueTable KnownTypes(StructureImpl filter = default)
532535 {
533536 var result = new ValueTable ( ) ;
534537
535- var nameColumn = result . Columns . Add ( "Имя" , TypeDescription . StringType ( ) ) ;
536- var valueColumn = result . Columns . Add ( "Значение" , new TypeDescription ( new List < BslTypeValue > ( ) { new BslTypeValue ( BasicTypes . Type ) } ) ) ;
537- var primitiveColumn = result . Columns . Add ( "Примитивный" , TypeDescription . BooleanType ( ) ) ;
538- var userColumn = result . Columns . Add ( "Пользовательский" , TypeDescription . BooleanType ( ) ) ;
539- var collectionColumn = result . Columns . Add ( "Коллекция" , TypeDescription . BooleanType ( ) ) ;
538+ var nameColumn = result . Columns . AddUnchecked ( "Имя" , "Имя" , TypeDescription . StringType ( ) ) ;
539+ var valueColumn = result . Columns . AddUnchecked ( "Значение" , "Значение" , new TypeDescription ( new [ ] { new BslTypeValue ( BasicTypes . Type ) } ) ) ;
540+ var primitiveColumn = result . Columns . AddUnchecked ( "Примитивный" , "Примитивный" , TypeDescription . BooleanType ( ) ) ;
541+ var userColumn = result . Columns . AddUnchecked ( "Пользовательский" , "Пользовательский" , TypeDescription . BooleanType ( ) ) ;
542+ var collectionColumn = result . Columns . AddUnchecked ( "Коллекция" , "Коллекция" , TypeDescription . BooleanType ( ) ) ;
540543
541544 _typeManager . RegisteredTypes ( ) . ForEach ( descriptor =>
542545 {
0 commit comments