public static void AnalyzeEnumValuesCaptions(SyntaxNodeAnalysisContext context, EnumValueSyntax syntax) { if (syntax == null) { return; } PropertyListSyntax propertyListSyntax = syntax.PropertyList; PropertySyntax propertySyntax = GetProperty(propertyListSyntax.Properties, "Caption"); if (propertySyntax == null) { ReportEnumValueMustHaveCaptionProperty(context, propertyListSyntax.GetLocation(), syntax.Name.ToString(), syntax.Kind, syntax.Name); } }
public static void AnalyzePagePartsCaptions(SyntaxNodeAnalysisContext context, dynamic syntax) { if (syntax != null) { PropertyListSyntax propertyListSyntax = syntax.PropertyList; PropertySyntax propertySyntax = GetProperty(propertyListSyntax.Properties, "Caption"); PropertySyntax showCaptionPropertySyntax = GetProperty(propertyListSyntax.Properties, "ShowCaption"); if (showCaptionPropertySyntax != null) { dynamic showCaptionPropertyValueSyntax = showCaptionPropertySyntax.Value; if (showCaptionPropertyValueSyntax.Value.Value.Value == "false") { return; } } if (propertySyntax == null) { ReportPagePartsMustHaveCaptionProperty(context, propertyListSyntax.GetLocation(), syntax.Name.ToString(), syntax.Kind, syntax.Name); } } }