public static bool TryEnableAssembly()

in Managed/PseudoLoc/PseudoLocalizer.cs [83:116]


        public static bool TryEnableAssembly(Assembly assembly)
        {
            bool retVal = false;
            if (assembly != null)
            {
                AssemblyName assemblyName = assembly.GetName();
                string resourceTypeName = assemblyName.Name + ".Resources";
                try
                {
                    Type resourceType = assembly.GetType(resourceTypeName, false);
                    if (resourceType != null)
                    {
                        Enable(resourceType);
                        retVal = true;
                    }
                    else
                    {
                        DebugTrace("PLOC: no type {0} found in the assembly {1}",
                            resourceTypeName,
                            assembly.FullName);
                    }
                }
                catch (Exception ex)
                {
                    DebugTrace(ex.ToString());
                }
            }
            else
            {
                DebugTrace("assembly should not be null");
            }

            return retVal;
        }