Ejemplo n.º 1
0
        public void Dispose()
        {
            if (config != null)
            {
                config.Dispose();
                config = null;
            }

            if (inputData != null)
            {
                inputData.Dispose();
                inputData = null;
            }

            if (sqlContext != null)
            {
                sqlContext.Dispose();
            }

            if (logWriter != null)
            {
                logWriter.Dispose();
                logWriter = null;
            }

            if (outputTextWriter != null)
            {
                outputTextWriter.Dispose();
                outputTextWriter = null;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>

        public void Close()
        {
            try
            {
                WriteFooter();
            }
            finally
            {
                writer.Dispose();
                writer = null;
            }
        }
        public void ShouldBeConstructedWithAGivenDelimiterAndTextFileWriterAtGivenPath(char delimiter, char expected)
        {
            var file     = System.IO.File.Create("testFile.txt");
            var filePath = "";

            using (file)
                filePath = file.Name;

            var sut = new TextFileWriter(filePath, delimiter);

            Assert.That(sut.Delimiter, Is.EqualTo(expected));
            Assert.That(sut.FilePath, Is.EqualTo(filePath));

            sut.Dispose();
            System.IO.File.Delete(filePath);
        }
Ejemplo n.º 4
0
        public void Dispose()
        {
            lock (this)
            {
                if (!Disposed)
                {
                    Disposed = true;
                    GC.SuppressFinalize(this);

                    if (FTextWriter != null)
                    {
                        FTextWriter.Dispose();
                        FTextWriter = null;
                    }
                }
            }
        }
Ejemplo n.º 5
0
 public void Dispose()
 {
     _writer.Dispose();
 }