File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -532,13 +532,30 @@ private void ObjectSave()
532532 od . prop . CO_accessSRDO = AccessSRDO . no ;
533533 }
534534
535- for ( ushort i = 1 ; i < od . parent . Nosubindexes ; i ++ )
535+ // Default value
536+ bool setDefaultValueToAll = false ;
537+ if ( od . parent != null && od . Subindex > 0 && od . defaultvalue == "" && textBox_defaultValue . Text != "" )
536538 {
537- if ( od . parent . subobjects [ i ] . defaultvalue == "" )
539+ DialogResult confirm = MessageBox . Show ( "Do you want to apply Default value to all unset subobjects?" , MessageBoxButtons . YesNo ) ;
540+ if ( confirm == DialogResult . Yes )
538541 {
539- od . parent . subobjects [ i ] . defaultvalue = textBox_defaultValue . Text ;
542+ setDefaultValueToAll = true ;
540543 }
541544 }
545+ if ( setDefaultValueToAll )
546+ {
547+ for ( ushort i = 1 ; i < od . parent . Nosubindexes ; i ++ )
548+ {
549+ if ( od . parent . subobjects [ i ] . defaultvalue == "" )
550+ {
551+ od . parent . subobjects [ i ] . defaultvalue = textBox_defaultValue . Text ;
552+ }
553+ }
554+ }
555+ else
556+ {
557+ od . defaultvalue = textBox_defaultValue . Text ;
558+ }
542559
543560 od . actualvalue = textBox_actualValue . Text ;
544561 od . HighLimit = textBox_highLimit . Text ;
You can’t perform that action at this time.
0 commit comments