System.GAC.AssemblyCache.GetCulture C# (CSharp) Method

GetCulture() public static method

public static GetCulture ( IAssemblyName name ) : CultureInfo
name IAssemblyName
return System.Globalization.CultureInfo
        public static CultureInfo GetCulture(IAssemblyName name)
        {
            uint bufferSize = 255;
            IntPtr buffer = Marshal.AllocHGlobal((int) bufferSize);
            name.GetProperty(ASM_NAME.ASM_NAME_CULTURE, buffer, ref bufferSize);
            string result = Marshal.PtrToStringAuto(buffer);
            Marshal.FreeHGlobal(buffer);
            return new CultureInfo(result);
        }