Пример #1
0
        private void LoadCustomAssembly(string dll)
        {
            string dllPath = dll;

            try
            {
                dllPath = Path.Combine(SaveGameModPath, dll).NormalizePath();
                Log?.Invoke($"CustomAssemblyLoad: {dll} ({dllPath})", LogLevel.Message);
                var            loadedAssembly = Assembly.LoadFile(dllPath);
                CustomAssembly current        = null;
                CustomAssemblies.AddOrUpdate(dllPath,
                                             current = new CustomAssembly()
                {
                    FullAssemblyDllName = dllPath, LoadedAssembly = loadedAssembly
                },
                                             (d, a) => { current = a;  a.LoadedAssembly = loadedAssembly; return(a); });
            }
            catch (Exception error)
            {
                Log?.Invoke($"CustomAssemblyLoad: {dll} ({dllPath}) -> {error}", LogLevel.Error);
            }
        }