Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FileMARCWriter"/> class.
        /// </summary>
        /// <param name="filename">The filename.</param>
        /// <param name="recordEncoding">The record encoding.</param>
        /// <param name="append">if set to <c>true</c> [append].</param>
        public FileMARCWriter(string filename, RecordEncoding recordEncoding, bool append)
        {
            switch (recordEncoding)
            {
            case RecordEncoding.MARC8:
                encoding = new MARC8();
                break;

            case RecordEncoding.UTF8NoBOM:
                encoding = (Encoding) new UTF8Encoding();
                break;

            default:
                encoding = Encoding.UTF8;
                break;
            }

            writer = new StreamWriter(filename, append, encoding);
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FileMARCWriter"/> class.
        /// </summary>
        /// <param name="filename">The filename.</param>
        /// <param name="recordEncoding">The record encoding.</param>
        /// <param name="append">if set to <c>true</c> [append].</param>
        public FileMARCWriter(string filename, RecordEncoding recordEncoding, bool append)
        {
            encoding = recordEncoding == RecordEncoding.MARC8 ? new MARC8() : Encoding.UTF8;

            writer = new StreamWriter(filename, append, encoding);
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FileMARCWriter" /> class.
 /// </summary>
 /// <param name="filename">The filename.</param>
 /// <param name="recordEncoding">The record encoding.</param>
 public FileMARCWriter(string filename, RecordEncoding recordEncoding) : this(filename, recordEncoding, false)
 {
 }