@@ -30,25 +30,25 @@ public CreateUnitNumber() : base("Create UnitNumber", "CreateUnit",
30
30
}
31
31
32
32
public override void SetSelected ( int i , int j ) {
33
- SelectedItems [ i ] = DropDownItems [ i ] [ j ] ;
33
+ _selectedItems [ i ] = _dropDownItems [ i ] [ j ] ;
34
34
35
35
// if change is made to first (unit type) list we have to update lists
36
36
if ( i == 0 ) {
37
- var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , SelectedItems [ 0 ] ) ;
37
+ var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , _selectedItems [ 0 ] ) ;
38
38
UpdateQuantityUnitTypeFromUnitString ( unit ) ;
39
39
UpdateMeasureDictionary ( ) ;
40
- SelectedItems [ 1 ] = _selectedMeasure . ToString ( ) ;
40
+ _selectedItems [ 1 ] = _selectedMeasure . ToString ( ) ;
41
41
} else // if change is made to the measure of a unit
42
42
{
43
- _selectedMeasure = _measureDictionary [ SelectedItems . Last ( ) ] ;
43
+ _selectedMeasure = _measureDictionary [ _selectedItems . Last ( ) ] ;
44
44
UpdateUnitMeasureAndAbbreviation ( ) ;
45
45
}
46
46
47
47
base . UpdateUI ( ) ;
48
48
}
49
49
50
50
public override void VariableParameterMaintenance ( ) {
51
- var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , SelectedItems [ 0 ] ) ;
51
+ var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , _selectedItems [ 0 ] ) ;
52
52
string unitAbbreviation ;
53
53
switch ( unit ) {
54
54
case EngineeringUnits . Angle :
@@ -164,16 +164,16 @@ public override void VariableParameterMaintenance() {
164
164
}
165
165
166
166
protected override void InitialiseDropdowns ( ) {
167
- SpacerDescriptions = new List < string > ( new string [ ] { "Unit type" , "Measure" } ) ;
167
+ _spacerDescriptions = new List < string > ( new string [ ] { "Unit type" , "Measure" } ) ;
168
168
169
- DropDownItems = new List < List < string > > ( ) ;
170
- SelectedItems = new List < string > ( ) ;
169
+ _dropDownItems = new List < List < string > > ( ) ;
170
+ _selectedItems = new List < string > ( ) ;
171
171
172
- DropDownItems . Add ( Enum . GetNames ( typeof ( EngineeringUnits ) ) . ToList ( ) ) ;
173
- SelectedItems . Add ( DropDownItems [ 0 ] [ 1 ] ) ;
172
+ _dropDownItems . Add ( Enum . GetNames ( typeof ( EngineeringUnits ) ) . ToList ( ) ) ;
173
+ _selectedItems . Add ( _dropDownItems [ 0 ] [ 1 ] ) ;
174
174
175
- DropDownItems . Add ( Enum . GetNames ( typeof ( LengthUnit ) ) . ToList ( ) ) ;
176
- SelectedItems . Add ( DefaultUnits . LengthUnitGeometry . ToString ( ) ) ;
175
+ _dropDownItems . Add ( Enum . GetNames ( typeof ( LengthUnit ) ) . ToList ( ) ) ;
176
+ _selectedItems . Add ( DefaultUnits . LengthUnitGeometry . ToString ( ) ) ;
177
177
178
178
_quantity = new Length ( 0 , DefaultUnits . LengthUnitGeometry ) ;
179
179
_selectedMeasure = _quantity . Unit ;
@@ -182,7 +182,7 @@ protected override void InitialiseDropdowns() {
182
182
foreach ( UnitInfo unit in _quantity . QuantityInfo . UnitInfos )
183
183
_measureDictionary . Add ( unit . Name , unit . Value ) ;
184
184
185
- IsInitialised = true ;
185
+ _isInitialised = true ;
186
186
}
187
187
188
188
protected override void RegisterInputParams ( GH_InputParamManager pManager ) {
@@ -195,7 +195,7 @@ protected override void RegisterOutputParams(GH_OutputParamManager pManager) {
195
195
196
196
protected override void SolveInternal ( IGH_DataAccess DA ) {
197
197
if ( DA . GetData ( 0 , ref _value ) ) {
198
- var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , SelectedItems [ 0 ] ) ;
198
+ var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , _selectedItems [ 0 ] ) ;
199
199
200
200
switch ( unit ) {
201
201
case EngineeringUnits . Angle :
@@ -314,19 +314,19 @@ protected override void SolveInternal(IGH_DataAccess DA) {
314
314
}
315
315
316
316
protected override void UpdateUIFromSelectedItems ( ) {
317
- var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , SelectedItems [ 0 ] ) ;
317
+ var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , _selectedItems [ 0 ] ) ;
318
318
UpdateQuantityUnitTypeFromUnitString ( unit ) ;
319
319
UpdateMeasureDictionary ( ) ;
320
320
UpdateUnitMeasureAndAbbreviation ( ) ;
321
- _selectedMeasure = _measureDictionary [ SelectedItems . Last ( ) ] ;
321
+ _selectedMeasure = _measureDictionary [ _selectedItems . Last ( ) ] ;
322
322
base . UpdateUIFromSelectedItems ( ) ;
323
323
}
324
324
325
325
private void UpdateMeasureDictionary ( ) {
326
326
_measureDictionary = new Dictionary < string , Enum > ( ) ;
327
327
foreach ( UnitInfo unitype in _quantity . QuantityInfo . UnitInfos )
328
328
_measureDictionary . Add ( unitype . Name , unitype . Value ) ;
329
- DropDownItems [ 1 ] = _measureDictionary . Keys . ToList ( ) ;
329
+ _dropDownItems [ 1 ] = _measureDictionary . Keys . ToList ( ) ;
330
330
}
331
331
332
332
private void UpdateQuantityUnitTypeFromUnitString ( EngineeringUnits unit ) {
@@ -443,7 +443,7 @@ private void UpdateQuantityUnitTypeFromUnitString(EngineeringUnits unit) {
443
443
}
444
444
445
445
private void UpdateUnitMeasureAndAbbreviation ( ) {
446
- var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , SelectedItems [ 0 ] ) ;
446
+ var unit = ( EngineeringUnits ) Enum . Parse ( typeof ( EngineeringUnits ) , _selectedItems [ 0 ] ) ;
447
447
448
448
switch ( unit ) {
449
449
case EngineeringUnits . Angle :
0 commit comments