Пример #1
0
        private void CheckCustomAssemblies()
        {
            var processed = CustomAssemblies.Select(dll => dll.Key).ToList();

            Configuration?.Current?.CustomAssemblies?.ForEach(dll => {
                string dllPath = dll;
                try
                {
                    dllPath = Path.Combine(SaveGameModPath, dll).NormalizePath();
                    if (!CustomAssemblies.ContainsKey(dllPath))
                    {
                        LoadCustomAssembly(dllPath);
                    }
                    else
                    {
                        processed.Remove(dllPath);
                    }
                }
                catch (Exception error)
                {
                    Log?.Invoke($"CheckCustomAssemblies: {dll} ({dllPath}) -> {error}", LogLevel.Error);
                }
            });

            processed.ForEach(dll => CustomAssemblies.TryRemove(dll, out var customAssembly));
        }