@@ -53,13 +53,8 @@ public class Templater
5353 /// </summary>
5454 public ActiveUp . Net . Mail . Logger Logger
5555 {
56- get
57- {
58- if ( _logger == null )
59- _logger = new ActiveUp . Net . Mail . Logger ( ) ;
60- return _logger ;
61- }
62- set
56+ get { return _logger ?? ( _logger = new ActiveUp . Net . Mail . Logger ( ) ) ; }
57+ set
6358 {
6459 _logger = value ;
6560 }
@@ -70,13 +65,8 @@ public ActiveUp.Net.Mail.Logger Logger
7065 /// </summary>
7166 public ActiveUp . Net . Mail . Message Message
7267 {
73- get
74- {
75- if ( _message == null )
76- _message = new ActiveUp . Net . Mail . Message ( ) ;
77- return _message ;
78- }
79- set
68+ get { return _message ?? ( _message = new ActiveUp . Net . Mail . Message ( ) ) ; }
69+ set
8070 {
8171 _message = value ;
8272 }
@@ -334,23 +324,17 @@ private void ProcessXmlTemplate(string content)
334324
335325 if ( reader . GetAttribute ( "PADDINGDIR" ) != null && reader . GetAttribute ( "PADDINGDIR" ) != string . Empty )
336326 {
337- if ( reader . GetAttribute ( "PADDINGDIR" ) . ToUpper ( ) == "LEFT" )
338- fieldFormat . PaddingDir = PaddingDirection . Left ;
339- else
340- fieldFormat . PaddingDir = PaddingDirection . Right ;
341- ActiveUp . Net . Mail . Logger . AddEntry ( "Attribute PADDINGDIR: " + reader . GetAttribute ( "PADDINGDIR" ) , 0 ) ;
327+ fieldFormat . PaddingDir = reader . GetAttribute ( "PADDINGDIR" ) . ToUpper ( ) == "LEFT" ? PaddingDirection . Left : PaddingDirection . Right ;
328+ ActiveUp . Net . Mail . Logger . AddEntry ( "Attribute PADDINGDIR: " + reader . GetAttribute ( "PADDINGDIR" ) , 0 ) ;
342329 }
343330
344331 else if ( reader . GetAttribute ( "paddingdir" ) != null && reader . GetAttribute ( "paddingdir" ) != string . Empty )
345332 {
346- if ( reader . GetAttribute ( "paddingdir" ) . ToUpper ( ) == "left" )
347- fieldFormat . PaddingDir = PaddingDirection . Left ;
348- else
349- fieldFormat . PaddingDir = PaddingDirection . Right ;
350- ActiveUp . Net . Mail . Logger . AddEntry ( "Attribute paddingdir: " + reader . GetAttribute ( "paddingdir" ) , 0 ) ;
333+ fieldFormat . PaddingDir = reader . GetAttribute ( "paddingdir" ) . ToUpper ( ) == "left" ? PaddingDirection . Left : PaddingDirection . Right ;
334+ ActiveUp . Net . Mail . Logger . AddEntry ( "Attribute paddingdir: " + reader . GetAttribute ( "paddingdir" ) , 0 ) ;
351335 }
352336
353- if ( reader . GetAttribute ( "TOTALWIDTH" ) != null && reader . GetAttribute ( "TOTALWIDTH" ) != string . Empty )
337+ if ( reader . GetAttribute ( "TOTALWIDTH" ) != null && reader . GetAttribute ( "TOTALWIDTH" ) != string . Empty )
354338 {
355339 try
356340 {
@@ -652,14 +636,8 @@ private string LoadFileContent(string filename)
652636 /// </summary>
653637 public RegionCollection Regions
654638 {
655- get
656- {
657- if ( _regions == null )
658- _regions = new RegionCollection ( ) ;
659-
660- return _regions ;
661- }
662- set
639+ get { return _regions ?? ( _regions = new RegionCollection ( ) ) ; }
640+ set
663641 {
664642 _regions = value ;
665643 }
@@ -670,14 +648,8 @@ public RegionCollection Regions
670648 /// </summary>
671649 public ConditionalCollection Conditions
672650 {
673- get
674- {
675- if ( _conditions == null )
676- _conditions = new ConditionalCollection ( ) ;
677-
678- return _conditions ;
679- }
680- set
651+ get { return _conditions ?? ( _conditions = new ConditionalCollection ( ) ) ; }
652+ set
681653 {
682654 _conditions = value ;
683655 }
@@ -688,14 +660,8 @@ public ConditionalCollection Conditions
688660 /// </summary>
689661 public FieldFormatCollection FieldsFormats
690662 {
691- get
692- {
693- if ( _fieldsFormats == null )
694- _fieldsFormats = new FieldFormatCollection ( ) ;
695-
696- return _fieldsFormats ;
697- }
698- set
663+ get { return _fieldsFormats ?? ( _fieldsFormats = new FieldFormatCollection ( ) ) ; }
664+ set
699665 {
700666 _fieldsFormats = value ;
701667 }
@@ -723,13 +689,8 @@ public ActiveUp.Net.Mail.BodyTemplateCollection Bodies
723689 /// </summary>
724690 public ActiveUp . Net . Mail . ServerCollection SmtpServers
725691 {
726- get
727- {
728- if ( _smtpServers == null )
729- _smtpServers = new ActiveUp . Net . Mail . ServerCollection ( ) ;
730- return _smtpServers ;
731- }
732- set
692+ get { return _smtpServers ?? ( _smtpServers = new ActiveUp . Net . Mail . ServerCollection ( ) ) ; }
693+ set
733694 {
734695 _smtpServers = value ;
735696 }
@@ -740,13 +701,8 @@ public ActiveUp.Net.Mail.ServerCollection SmtpServers
740701 /// </summary>
741702 public ActiveUp . Net . Mail . ListTemplateCollection ListTemplates
742703 {
743- get
744- {
745- if ( _listTemplates == null )
746- _listTemplates = new ActiveUp . Net . Mail . ListTemplateCollection ( ) ;
747- return _listTemplates ;
748- }
749- set
704+ get { return _listTemplates ?? ( _listTemplates = new ActiveUp . Net . Mail . ListTemplateCollection ( ) ) ; }
705+ set
750706 {
751707 _listTemplates = value ;
752708 }
0 commit comments