@@ -147,23 +147,23 @@ public override void SetSelected(int i, int j) {
147
147
// input -1 to force update of catalogue sections to include/exclude superseeded
148
148
bool updateCat = false ;
149
149
if ( i == - 1 ) {
150
- _selectedItems [ 0 ] = "Catalogue" ;
150
+ SelectedItems [ 0 ] = "Catalogue" ;
151
151
updateCat = true ;
152
152
i = 0 ;
153
153
} else {
154
154
// change selected item
155
- _selectedItems [ i ] = _dropDownItems [ i ] [ j ] ;
155
+ SelectedItems [ i ] = DropDownItems [ i ] [ j ] ;
156
156
}
157
157
158
- if ( _selectedItems [ 0 ] == "Catalogue" ) {
158
+ if ( SelectedItems [ 0 ] == "Catalogue" ) {
159
159
// update spacer description to match catalogue dropdowns
160
- _spacerDescriptions [ 1 ] = "Catalogue" ;
160
+ SpacerDescriptions [ 1 ] = "Catalogue" ;
161
161
162
162
// if FoldMode is not currently catalogue state, then we update all lists
163
163
if ( _mode != FoldMode . Catalogue | updateCat ) {
164
164
// remove any existing selections
165
- while ( _selectedItems . Count > 1 )
166
- _selectedItems . RemoveAt ( 1 ) ;
165
+ while ( SelectedItems . Count > 1 )
166
+ SelectedItems . RemoveAt ( 1 ) ;
167
167
168
168
// set catalogue selection to all
169
169
_catalogueIndex = - 1 ;
@@ -177,27 +177,27 @@ public override void SetSelected(int i, int j) {
177
177
_sectionList = SqlReader . Instance . GetSectionsDataFromSQLite ( _typeNumbers , DataSource , _inclSS ) ;
178
178
179
179
// update displayed selections to all
180
- _selectedItems . Add ( _catalogueNames [ 0 ] ) ;
181
- _selectedItems . Add ( _typeNames [ 0 ] ) ;
182
- _selectedItems . Add ( _sectionList [ 0 ] ) ;
180
+ SelectedItems . Add ( _catalogueNames [ 0 ] ) ;
181
+ SelectedItems . Add ( _typeNames [ 0 ] ) ;
182
+ SelectedItems . Add ( _sectionList [ 0 ] ) ;
183
183
184
184
// call graphics update
185
185
Mode1Clicked ( ) ;
186
186
}
187
187
188
188
// update dropdown lists
189
- while ( _dropDownItems . Count > 1 )
190
- _dropDownItems . RemoveAt ( 1 ) ;
189
+ while ( DropDownItems . Count > 1 )
190
+ DropDownItems . RemoveAt ( 1 ) ;
191
191
192
192
// add catalogues (they will always be the same so no need to rerun sql call)
193
- _dropDownItems . Add ( _catalogueNames ) ;
193
+ DropDownItems . Add ( _catalogueNames ) ;
194
194
195
195
// type list
196
196
// if second list (i.e. catalogue list) is changed, update types list to account for that catalogue
197
197
if ( i == 1 ) {
198
198
// update catalogue index with the selected catalogue
199
199
_catalogueIndex = _catalogueNumbers [ j ] ;
200
- _selectedItems [ 1 ] = _catalogueNames [ j ] ;
200
+ SelectedItems [ 1 ] = _catalogueNames [ j ] ;
201
201
202
202
// update typelist with selected input catalogue
203
203
_typeData = SqlReader . Instance . GetTypesDataFromSQLite ( _catalogueIndex , DataSource , _inclSS ) ;
@@ -216,17 +216,17 @@ public override void SetSelected(int i, int j) {
216
216
_sectionList = SqlReader . Instance . GetSectionsDataFromSQLite ( types , DataSource , _inclSS ) ;
217
217
218
218
// update selections to display first item in new list
219
- _selectedItems [ 2 ] = _typeNames [ 0 ] ;
220
- _selectedItems [ 3 ] = _sectionList [ 0 ] ;
219
+ SelectedItems [ 2 ] = _typeNames [ 0 ] ;
220
+ SelectedItems [ 3 ] = _sectionList [ 0 ] ;
221
221
}
222
- _dropDownItems . Add ( _typeNames ) ;
222
+ DropDownItems . Add ( _typeNames ) ;
223
223
224
224
// section list
225
225
// if third list (i.e. types list) is changed, update sections list to account for these section types
226
226
if ( i == 2 ) {
227
227
// update catalogue index with the selected catalogue
228
228
_typeIndex = _typeNumbers [ j ] ;
229
- _selectedItems [ 2 ] = _typeNames [ j ] ;
229
+ SelectedItems [ 2 ] = _typeNames [ j ] ;
230
230
231
231
// create type list
232
232
List < int > types ;
@@ -241,15 +241,15 @@ public override void SetSelected(int i, int j) {
241
241
_sectionList = SqlReader . Instance . GetSectionsDataFromSQLite ( types , DataSource , _inclSS ) ;
242
242
243
243
// update selected section to be all
244
- _selectedItems [ 3 ] = _sectionList [ 0 ] ;
244
+ SelectedItems [ 3 ] = _sectionList [ 0 ] ;
245
245
}
246
- _dropDownItems . Add ( _sectionList ) ;
246
+ DropDownItems . Add ( _sectionList ) ;
247
247
248
248
// selected profile
249
249
// if fourth list (i.e. section list) is changed, updated the sections list to only be that single profile
250
250
if ( i == 3 ) {
251
251
// update displayed selected
252
- _selectedItems [ 3 ] = _sectionList [ j ] ;
252
+ SelectedItems [ 3 ] = _sectionList [ j ] ;
253
253
}
254
254
255
255
if ( _search == "" )
@@ -258,27 +258,27 @@ public override void SetSelected(int i, int j) {
258
258
base . UpdateUI ( ) ;
259
259
} else {
260
260
// update spacer description to match none-catalogue dropdowns
261
- _spacerDescriptions [ 1 ] = "Measure" ; // = new List<string>(new string[]
261
+ SpacerDescriptions [ 1 ] = "Measure" ; // = new List<string>(new string[]
262
262
263
263
if ( _mode != FoldMode . Other ) {
264
264
// remove all catalogue dropdowns
265
- while ( _dropDownItems . Count > 1 )
266
- _dropDownItems . RemoveAt ( 1 ) ;
265
+ while ( DropDownItems . Count > 1 )
266
+ DropDownItems . RemoveAt ( 1 ) ;
267
267
268
268
// add length measure dropdown list
269
- _dropDownItems . Add ( UnitsHelper . GetFilteredAbbreviations ( EngineeringUnits . Length ) ) ;
269
+ DropDownItems . Add ( UnitsHelper . GetFilteredAbbreviations ( EngineeringUnits . Length ) ) ;
270
270
271
271
// set selected length
272
- _selectedItems [ 1 ] = _lengthUnit . ToString ( ) ;
272
+ SelectedItems [ 1 ] = _lengthUnit . ToString ( ) ;
273
273
}
274
274
275
275
if ( i == 0 ) {
276
276
// update profile type if change is made to first dropdown menu
277
- _type = profileTypes [ _selectedItems [ 0 ] ] ;
277
+ _type = profileTypes [ SelectedItems [ 0 ] ] ;
278
278
Mode2Clicked ( ) ;
279
279
} else {
280
280
// change unit
281
- _lengthUnit = ( LengthUnit ) UnitsHelper . Parse ( typeof ( LengthUnit ) , _selectedItems [ i ] ) ;
281
+ _lengthUnit = ( LengthUnit ) UnitsHelper . Parse ( typeof ( LengthUnit ) , SelectedItems [ i ] ) ;
282
282
283
283
base . UpdateUI ( ) ;
284
284
}
@@ -830,25 +830,25 @@ public override bool Write(GH_IWriter writer) {
830
830
}
831
831
832
832
protected internal override void InitialiseDropdowns ( ) {
833
- _spacerDescriptions = new List < string > ( new string [ ] {
833
+ SpacerDescriptions = new List < string > ( new string [ ] {
834
834
"Profile type" ,
835
835
"Measure" ,
836
836
"Type" ,
837
837
"Profile"
838
838
} ) ;
839
839
840
- _dropDownItems = new List < List < string > > ( ) ;
841
- _selectedItems = new List < string > ( ) ;
840
+ DropDownItems = new List < List < string > > ( ) ;
841
+ SelectedItems = new List < string > ( ) ;
842
842
843
843
// Profile type
844
- _dropDownItems . Add ( profileTypes . Keys . ToList ( ) ) ;
845
- _selectedItems . Add ( "Rectangle" ) ;
844
+ DropDownItems . Add ( profileTypes . Keys . ToList ( ) ) ;
845
+ SelectedItems . Add ( "Rectangle" ) ;
846
846
847
847
// Length
848
- _dropDownItems . Add ( UnitsHelper . GetFilteredAbbreviations ( EngineeringUnits . Length ) ) ;
849
- _selectedItems . Add ( Length . GetAbbreviation ( _lengthUnit ) ) ;
848
+ DropDownItems . Add ( UnitsHelper . GetFilteredAbbreviations ( EngineeringUnits . Length ) ) ;
849
+ SelectedItems . Add ( Length . GetAbbreviation ( _lengthUnit ) ) ;
850
850
851
- _isInitialised = true ;
851
+ IsInitialised = true ;
852
852
}
853
853
854
854
protected virtual int GetNumberOfGenericInputs ( ) {
@@ -982,11 +982,11 @@ protected List<IProfile> SolveInstanceForCatalogueProfile(IGH_DataAccess da) {
982
982
_typeIndex = - 1 ;
983
983
UpdateSecionList ( ) ;
984
984
985
- _selectedItems [ 2 ] = "All" ;
986
- _dropDownItems [ 2 ] = _typeNames ;
985
+ SelectedItems [ 2 ] = "All" ;
986
+ DropDownItems [ 2 ] = _typeNames ;
987
987
988
- _selectedItems [ 3 ] = "All" ;
989
- _dropDownItems [ 3 ] = _sectionList ;
988
+ SelectedItems [ 3 ] = "All" ;
989
+ DropDownItems [ 3 ] = _sectionList ;
990
990
991
991
base . UpdateUI ( ) ;
992
992
}
@@ -1016,8 +1016,8 @@ protected List<IProfile> SolveInstanceForCatalogueProfile(IGH_DataAccess da) {
1016
1016
1017
1017
// filter by search pattern
1018
1018
var filteredlist = new List < string > ( ) ;
1019
- if ( _selectedItems [ 3 ] != "All" ) {
1020
- if ( ! MatchAndAdd ( _selectedItems [ 3 ] , _search , ref filteredlist , tryHard ) ) {
1019
+ if ( SelectedItems [ 3 ] != "All" ) {
1020
+ if ( ! MatchAndAdd ( SelectedItems [ 3 ] , _search , ref filteredlist , tryHard ) ) {
1021
1021
_profileDescriptions = new List < string > ( ) ;
1022
1022
AddRuntimeMessage ( GH_RuntimeMessageLevel . Warning , "No profile found that matches selected profile and search!" ) ;
1023
1023
}
@@ -1362,9 +1362,9 @@ protected virtual void UpdateParameters() {
1362
1362
}
1363
1363
1364
1364
protected override void UpdateUIFromSelectedItems ( ) {
1365
- if ( _selectedItems [ 0 ] == "Catalogue" ) {
1365
+ if ( SelectedItems [ 0 ] == "Catalogue" ) {
1366
1366
// update spacer description to match catalogue dropdowns
1367
- _spacerDescriptions = new List < string > ( new string [ ]
1367
+ SpacerDescriptions = new List < string > ( new string [ ]
1368
1368
{
1369
1369
"Profile type" , "Catalogue" , "Type" , "Profile"
1370
1370
} ) ;
@@ -1375,15 +1375,15 @@ protected override void UpdateUIFromSelectedItems() {
1375
1375
1376
1376
Mode1Clicked ( ) ;
1377
1377
1378
- _profileDescriptions = new List < string > ( ) { "CAT " + _selectedItems [ 3 ] } ;
1378
+ _profileDescriptions = new List < string > ( ) { "CAT " + SelectedItems [ 3 ] } ;
1379
1379
} else {
1380
1380
// update spacer description to match none-catalogue dropdowns
1381
- _spacerDescriptions = new List < string > ( new string [ ]
1381
+ SpacerDescriptions = new List < string > ( new string [ ]
1382
1382
{
1383
1383
"Profile type" , "Measure" , "Type" , "Profile"
1384
1384
} ) ;
1385
1385
1386
- _type = profileTypes [ _selectedItems [ 0 ] ] ;
1386
+ _type = profileTypes [ SelectedItems [ 0 ] ] ;
1387
1387
Mode2Clicked ( ) ;
1388
1388
}
1389
1389
@@ -1415,15 +1415,15 @@ private static bool MatchAndAdd(string item, string pattern, ref List<string> li
1415
1415
}
1416
1416
1417
1417
private void UpdateProfileDescriptions ( ) {
1418
- if ( _selectedItems [ 3 ] == "All" ) {
1418
+ if ( SelectedItems [ 3 ] == "All" ) {
1419
1419
_profileDescriptions = new List < string > ( ) ;
1420
1420
foreach ( string profile in _sectionList ) {
1421
1421
if ( profile == "All" )
1422
1422
continue ;
1423
1423
_profileDescriptions . Add ( "CAT " + profile ) ;
1424
1424
}
1425
1425
} else
1426
- _profileDescriptions = new List < string > ( ) { "CAT " + _selectedItems [ 3 ] } ;
1426
+ _profileDescriptions = new List < string > ( ) { "CAT " + SelectedItems [ 3 ] } ;
1427
1427
}
1428
1428
1429
1429
private void UpdateSecionList ( ) {
0 commit comments