private static bool SealedClassWithVirtualMember(AnalyzerOptions options, ISymbol symbol) { foreach (var location in symbol.Locations) { if (options.GetConfigurationValue(location.SourceTree.FilePath, RuleIdentifiers.ClassMustBeSealed + ".class_with_virtual_member_shoud_be_sealed", (bool?)null) == true) { return(true); } } return(false); }
private static bool PublicClassShouldBeSealed(AnalyzerOptions options, ISymbol symbol) { foreach (var location in symbol.Locations) { if (options.GetConfigurationValue(location.SourceTree.FilePath, RuleIdentifiers.ClassMustBeSealed + ".public_class_should_be_sealed", (bool?)null) == true) { return(true); } } return(false); }
private static bool SealedClassWithVirtualMember(AnalyzerOptions options, ISymbol symbol) { return(options.GetConfigurationValue(symbol, RuleIdentifiers.ClassMustBeSealed + ".class_with_virtual_member_shoud_be_sealed", defaultValue: false)); }
private static bool PublicClassShouldBeSealed(AnalyzerOptions options, ISymbol symbol) { return(options.GetConfigurationValue(symbol, RuleIdentifiers.ClassMustBeSealed + ".public_class_should_be_sealed", defaultValue: false)); }
public static ReportDiagnostic?GetSeverity(this AnalyzerOptions options, DiagnosticDescriptor descriptor, string filePath) { return(options.GetConfigurationValue(filePath, descriptor.Id + ".severity", defaultValue: default(ReportDiagnostic?))); }
public static bool IsEnabled(this AnalyzerOptions options, DiagnosticDescriptor descriptor, string filePath) { return(options.GetConfigurationValue(filePath, descriptor.Id + ".enabled", defaultValue: true)); }