File tree Expand file tree Collapse file tree 1 file changed +24
-10
lines changed
src/PowerShellEditorServices.Protocol/Server Expand file tree Collapse file tree 1 file changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -92,12 +92,33 @@ public void Update(
9292 }
9393 }
9494
95- public class CodeFormattingSettings
95+ public class AbstractSettings
96+ {
97+ public AbstractSettings ( )
98+ {
99+
100+ }
101+
102+ public AbstractSettings ( AbstractSettings abstractSettings )
103+ {
104+ if ( abstractSettings == null )
105+ {
106+ throw new ArgumentNullException ( nameof ( abstractSettings ) ) ;
107+ }
108+
109+ foreach ( var prop in this . GetType ( ) . GetProperties ( BindingFlags . Public | BindingFlags . Instance ) )
110+ {
111+ prop . SetValue ( this , prop . GetValue ( abstractSettings ) ) ;
112+ }
113+ }
114+ }
115+
116+ public class CodeFormattingSettings : AbstractSettings
96117 {
97118 /// <summary>
98119 /// Default constructor.
99120 /// </summary>
100- public CodeFormattingSettings ( )
121+ public CodeFormattingSettings ( ) : base ( )
101122 {
102123
103124 }
@@ -107,16 +128,9 @@ public CodeFormattingSettings()
107128 /// </summary>
108129 /// <param name="codeFormattingSettings">An instance of type CodeFormattingSettings.</param>
109130 public CodeFormattingSettings ( CodeFormattingSettings codeFormattingSettings )
131+ : base ( codeFormattingSettings )
110132 {
111- if ( codeFormattingSettings == null )
112- {
113- throw new ArgumentNullException ( nameof ( codeFormattingSettings ) ) ;
114- }
115133
116- foreach ( var prop in this . GetType ( ) . GetProperties ( BindingFlags . Public | BindingFlags . Instance ) )
117- {
118- prop . SetValue ( this , prop . GetValue ( codeFormattingSettings ) ) ;
119- }
120134 }
121135
122136 public bool OpenBraceOnSameLine { get ; set ; }
You can’t perform that action at this time.
0 commit comments