Exemple #1
0
        public override void Dispose()
        {
            _fileWriter?.Dispose();
            _fileWriter = null;

            base.Dispose();
        }
Exemple #2
0
        private static void Main()
        {
            var logger = new LogFileWriter("file.log");

            logger.WriteToLog("Program has stated.");
            logger.WriteToLog("Somewhere in the middle.");
            logger.WriteToLog("Finish");

            //throw new Exception();

            logger.Dispose();
        }