protected static bool CheckResxGeneratedFile(SemanticModel model, SyntaxNode attribute, SyntaxNode argument, CancellationToken cancellationToken) { if (!CheckDesignerFile(model.SyntaxTree)) { return(false); } INamedTypeSymbol generatedCode = WellKnownTypes.GeneratedCodeAttribute(model.Compilation); if (model.GetSymbolInfo(attribute, cancellationToken).Symbol?.ContainingType?.Equals(generatedCode) != true) { return(false); } Optional <object> constValue = model.GetConstantValue(argument); if (!constValue.HasValue) { return(false); } var stringValue = constValue.Value as string; if (stringValue == null) { return(false); } if (stringValue.IndexOf(StronglyTypedResourceBuilder, StringComparison.OrdinalIgnoreCase) < 0) { return(false); } return(true); }