BananaMpq.View.Infrastructure.PluginLoader.PluginLoader C# (CSharp) Method

PluginLoader() static private method

static private PluginLoader ( ) : System
return System
        static PluginLoader()
        {
            try
            {
                // seriously. don't ever do this. my eyes bleed, but I'm to lazy to do this the right way
                var asm = Assembly.LoadFrom("BananaMpq.View.NavMesh.dll");
                var pluginType = asm.GetExportedTypes().First(typeof(INavMeshPlugin).IsAssignableFrom);
                // assume a parameterless constructor:
                NavMeshPlugin = (INavMeshPlugin)Activator.CreateInstance(pluginType);
            }
            catch
            {
                Console.Error.WriteLine("No plugin was found. Falling back to non NavMesh stuff");
            }
        }
PluginLoader