using System; using System.Collections.Generic; using System.Linq; using System.Text; using Patcher.Data.Patch; using Patcher.DB; using System.IO; namespace Patcher { class Context { public readonly IConfig config; public readonly Func> getPatchesList; public readonly Func loadPatch; public readonly IDBTraits DbDriver; private static readonly Dictionary DB_DRIVERS = new Dictionary { { "oracle", OracleDBTraits.instance }, { "oracle-faketransactional", OracleFakeTransactionalDBTraits.instance }, }; public Context(IConfig config, Func> getPatchesListUnsorted, Func loadPatch) { this.config = config; this.getPatchesList = () => (from patchId in getPatchesListUnsorted() orderby patchId ascending select patchId).ToList(); this.loadPatch = loadPatch; this.DbDriver = DB_DRIVERS[config.DbDriverName]; } } }