public WriteCache(ICacheDBHandler <KeyType, ValueType> DBHandler) { this.DBHandler = DBHandler; this.ExecuteType = DBHandler.ExecuteType; this.DBHandler.SaveResultCallback += new SaveResultCallbackHandler <KeyType, ValueType>(DBHandler_SaveResultCallback); SaveThread = new Thread(new ThreadStart(SaveData)); SaveThread.Start(); }
public Cache(ICacheDBHandler <KeyType, ValueType> DBHandler) { DBWriter = new WriteCache <KeyType, ValueType>(DBHandler); this.DBHandler = DBHandler; MaxIdentity = DBHandler.GetMaxID <ValueType>(); GetNewIdentity();// ID++ DBWriter.OnDiscardData += new WriteCache <KeyType, ValueType> .OnDiscardDataHandler(DBWriter_OnDiscardData); }