public static IEnumerable <string> Interval
        (
            [NotNull] IIrbisConnection connection,
            [NotNull] string database,
            [NotNull] string format,
            int firstMfn,
            int lastMfn,
            int batchSize
        )
        {
            Sure.NotNull(connection, "connection");
            Sure.NotNullNorEmpty(database, "database");
            Sure.NotNullNorEmpty(format, "format");
            Sure.Positive(firstMfn, "firstMfn");
            Sure.Positive(lastMfn, "lastMfn");
            if (batchSize < 1)
            {
                Log.Error
                (
                    "BatchRecordFormatter::Interval: "
                    + "batchSize="
                    + batchSize
                );

                throw new ArgumentOutOfRangeException("batchSize");
            }

            int maxMfn = connection.GetMaxMfn(database) - 1;

            if (maxMfn == 0)
            {
                return(StringUtility.EmptyArray);
            }

            lastMfn = Math.Min(lastMfn, maxMfn);
            if (firstMfn > lastMfn)
            {
                return(StringUtility.EmptyArray);
            }

            BatchRecordFormatter result = new BatchRecordFormatter
                                          (
                connection,
                database,
                format,
                batchSize,
                Enumerable.Range(firstMfn, lastMfn - firstMfn + 1)
                                          );

            return(result);
        }
        public static IEnumerable <string> WholeDatabase
        (
            [NotNull] IIrbisConnection connection,
            [NotNull] string database,
            [NotNull] string format,
            int batchSize
        )
        {
            Sure.NotNull(connection, "connection");
            Sure.NotNullNorEmpty(database, "database");
            Sure.NotNullNorEmpty(format, "format");
            if (batchSize < 1)
            {
                Log.Error
                (
                    "BatchRecordFormatter::WholeDatabase: "
                    + "batchSize="
                    + batchSize
                );

                throw new ArgumentOutOfRangeException("batchSize");
            }

            int maxMfn = connection.GetMaxMfn(database) - 1;

            if (maxMfn == 0)
            {
                return(new string[0]);
            }

            BatchRecordFormatter result = new BatchRecordFormatter
                                          (
                connection,
                database,
                format,
                batchSize,
                Enumerable.Range(1, maxMfn)
                                          );

            return(result);
        }