System.Resources.ResourceManager.GetNeutralLanguageForAssembly C# (CSharp) Méthode

GetNeutralLanguageForAssembly() private static méthode

private static GetNeutralLanguageForAssembly ( Assembly assembly ) : string
assembly Assembly
Résultat string
        private static string GetNeutralLanguageForAssembly(Assembly assembly)
        {
            foreach (CustomAttributeData cad in assembly.CustomAttributes)
            {
                if (cad.AttributeType.FullName.Equals("System.Resources.NeutralResourcesLanguageAttribute"))
                {
                    foreach (CustomAttributeTypedArgument cata in cad.ConstructorArguments)
                    {
                        if (cata.ArgumentType.Equals(typeof(System.String)))
                        {
                            return (string) cata.Value;
                        }
                    }
                }
            }
            
            // The assembly is not tagged with NeutralResourcesLanguageAttribute
            return null;
        }