public virtual void Initialize() { string tableName = Name.ToLower() + "_settings"; Storage.Storage storage = d_job.Optimizer.Storage; storage.Query("CREATE TABLE `" + tableName + "` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT, `value` TEXT)"); foreach (KeyValuePair <string, object> pair in d_settings) { storage.Query("INSERT INTO `" + tableName + "` (`name`, `value`) VALUES (@0, @1)", pair.Key, pair.Value.ToString()); } }
public virtual void FromStorage(Storage.Storage storage, Storage.Records.Optimizer optimizer) { /* Settings */ d_settings.Clear(); storage.Query("SELECT `name`, `value` FROM `" + Name.ToLower() + "_settings`", delegate(System.Data.IDataReader reader) { d_settings[reader.GetString(0)] = reader.GetString(1); return(true); }); }