@@ -182,21 +182,21 @@ public static class SystemEventNames
182
182
SystemEventNode sysEvent = systemEvents[ i] ;
183
183
184
184
// Add the ref docs for each constant
185
- sourceBuilder. AppendLine ( $" { Indent } { Indent } /// <summary>");
186
- sourceBuilder. AppendLine (
185
+ sourceBuilder. AppendIndentedLine ( 2 , " /// <summary>");
186
+ sourceBuilder. AppendIndentedLine ( 2 ,
187
187
! isSystemEventsLibrary
188
- ? $" { Indent } { Indent } /// The value of the Event Type stored in <see cref=\"EventGridEvent.EventType\"/> and <see cref=\"CloudEvent.Type\"/> "
189
- : $" { Indent } { Indent } /// The value of the Event Type stored in <see cref=\"CloudEvent.Type\"/> ");
188
+ ? " /// The value of the Event Type stored in <see cref=\"EventGridEvent.EventType\"/> and <see cref=\"CloudEvent.Type\"/> "
189
+ : " /// The value of the Event Type stored in <see cref=\"CloudEvent.Type\"/> ");
190
190
191
- sourceBuilder. AppendLine ( $" { Indent } { Indent } /// for the <see cref=\"{sysEvent.EventName}\"/> system event.");
192
- sourceBuilder. AppendLine ( $" { Indent } { Indent } /// </summary>");
191
+ sourceBuilder. AppendIndentedLine ( 2 , $" /// for the <see cref=\"{sysEvent.EventName}\"/> system event.");
192
+ sourceBuilder. AppendIndentedLine ( 2 , " /// </summary>");
193
193
194
194
// Add the constant
195
- sourceBuilder. AppendLine ( $" { Indent } { Indent } public const string { sysEvent. EventConstantName} = { sysEvent. EventType} ; ") ;
195
+ sourceBuilder. AppendIndentedLine ( 2 , $" public const string { sysEvent. EventConstantName} = { sysEvent. EventType} ; ") ;
196
196
}
197
197
198
- sourceBuilder. Append ( $ @"{Indent}} }
199
- }} " ) ;
198
+ sourceBuilder. AppendIndentedLine ( 1 , @" }
199
+ }" ) ;
200
200
return sourceBuilder. ToString( ) ;
201
201
}
202
202
@@ -225,14 +225,14 @@ public static object AsSystemEventData(string eventType, JsonElement data)
225
225
foreach ( SystemEventNode sysEvent in systemEvents)
226
226
{
227
227
// Add each an entry for each system event to the dictionary containing a mapping from constant name to deserialization method.
228
- sourceBuilder. AppendLine (
229
- $ "{ Indent } { Indent } { Indent } if (eventTypeSpan.Equals(SystemEventNames.{ sysEvent . EventConstantName } .AsSpan(), StringComparison.OrdinalIgnoreCase))") ;
230
- sourceBuilder. AppendLine (
231
- $ "{ Indent } { Indent } { Indent } { Indent } return { sysEvent . EventName } .{ sysEvent . DeserializeMethod } (data{ ( isSystemEventsLibrary ? ", null" : string . Empty ) } );") ;
228
+ sourceBuilder. AppendIndentedLine ( 3 ,
229
+ $ "if (eventTypeSpan.Equals(SystemEventNames.{ sysEvent . EventConstantName } .AsSpan(), StringComparison.OrdinalIgnoreCase))") ;
230
+ sourceBuilder. AppendIndentedLine ( 4 ,
231
+ $ "return { sysEvent . EventName } .{ sysEvent . DeserializeMethod } (data{ ( isSystemEventsLibrary ? ", null" : string . Empty ) } );") ;
232
232
}
233
- sourceBuilder. AppendLine ( $ " { Indent } { Indent } { Indent } return null;") ;
234
- sourceBuilder. AppendLine ( $ " { Indent } { Indent } } }") ;
235
- sourceBuilder. AppendLine ( $ " { Indent } } }") ;
233
+ sourceBuilder. AppendIndentedLine ( 3 , " return null;") ;
234
+ sourceBuilder. AppendIndentedLine ( 2 , " }") ;
235
+ sourceBuilder. AppendIndentedLine ( 1 , " }") ;
236
236
sourceBuilder. AppendLine ( "}" ) ;
237
237
238
238
return sourceBuilder. ToString ( ) ;
0 commit comments