Example #1
0
 /// <summary>Constructor</summary>
 /// <param name="dataStoreWriter">The datastore writer that called this constructor.</param>
 /// <param name="checkpointName">The new checkpoint name to create.</param>
 /// <param name="fileNamesToStore">Names of files to store in checkpoint.</param>
 public AddCheckpointCommand(DataStoreWriter dataStoreWriter,
                             string checkpointName,
                             IEnumerable <string> fileNamesToStore)
 {
     writer              = dataStoreWriter;
     newCheckpointName   = checkpointName;
     namesOfFilesToStore = fileNamesToStore;
 }
Example #2
0
        /// <summary>Open the database.</summary>
        public void Open()
        {
            if (FileName == null)
            {
                UpdateFileName();
            }

            if (useFirebird)
            {
                connection = new Firebird();
            }
            else
            {
                connection = new SQLite();
            }

            connection.OpenDatabase(FileName, readOnly: false);

            Exception caughtException = null;

            try
            {
                if (dbReader == null)
                {
                    dbReader = new DataStoreReader();
                }
                dbReader.SetConnection(connection);
            }
            catch (Exception e)
            {
                caughtException = e;
            }
            try
            {
                if (dbWriter == null)
                {
                    dbWriter = new DataStoreWriter();
                }
                dbWriter.SetConnection(connection);
            }
            catch (Exception e)
            {
                caughtException = e;
            }
            if (caughtException != null)
            {
                throw caughtException;
            }
        }
 /// <summary>Constructor</summary>
 /// <param name="dataStoreWriter">The datastore writer that called this constructor.</param>
 /// <param name="checkpointID">The new checkpoint name to create.</param>
 public RevertCheckpointCommand(DataStoreWriter dataStoreWriter,
                                int checkpointID)
 {
     writer = dataStoreWriter;
     checkpointIDToRevertTo = checkpointID;
 }
 /// <summary>Constructor</summary>
 /// <param name="dataStoreWriter">The datastore writer that called this constructor.</param>
 /// <param name="checkpointID">The new checkpoint name to create.</param>
 public DeleteCheckpointCommand(DataStoreWriter dataStoreWriter,
                                int checkpointID)
 {
     writer = dataStoreWriter;
     checkpointIDToDelete = checkpointID;
 }
Example #5
0
 public CleanCommand(DataStoreWriter dataStoreWriter, IEnumerable <string> names, IEnumerable <int> ids)
 {
     writer     = dataStoreWriter;
     this.names = names;
     this.ids   = ids;
 }