Esempio n. 1
0
            public override bool Tick()
            {
                if (StreamStatus.Stream == null || mWriteBytes == null)
                {
                    return(true);
                }

                try
                {
                    WriteBytes(StreamStatus.Stream, mRecordWordCount, mWriteBytes);
                    StreamStatus.UpdatePosition();
                }
                catch (Exception exception)
                {
                    OnReportingEvent(new ReportingEventArgs(Severity.Error, "exception while writing file " + StreamStatus.FileName + ": " + exception.Message));
                }

                return(true);
            }
Esempio n. 2
0
            public override bool Tick()
            {
                if (StreamStatus.Stream == null || mWriteBytes == null)
                {
                    return(true);
                }

                try
                {
                    var writer = new StreamWriter(StreamStatus.Stream, Encoding.ASCII);
                    writer.WriteLine(createStringFromBytes(mWriteBytes, mRecordWordCount * FullWord.ByteCount));
                    writer.Flush();
                    StreamStatus.UpdatePosition();
                }
                catch (Exception exception)
                {
                    OnReportingEvent(new ReportingEventArgs(Severity.Error, "exception while writing file " + StreamStatus.FileName + ": " + exception.Message));
                }

                return(true);
            }