private static StringComparison GetMethodNameComparison(ITypeResolver typeResolver) { StringComparison stringComparison = StringComparison.Ordinal; ProjectXamlContext projectXamlContext = ProjectXamlContext.FromProjectContext(typeResolver as IProjectContext); if (projectXamlContext == null) { return(stringComparison); } IProject project = (IProject)projectXamlContext.GetService(typeof(IProject)); if (project == null || project.CodeDocumentType == null) { return(stringComparison); } ICodeGeneratorHost codeGeneratorHost = project.CodeDocumentType as ICodeGeneratorHost; if (codeGeneratorHost == null || (codeGeneratorHost.CodeDomProvider.LanguageOptions & LanguageOptions.CaseInsensitive) != LanguageOptions.CaseInsensitive) { return(stringComparison); } stringComparison = StringComparison.OrdinalIgnoreCase; return(stringComparison); }