Beispiel #1
0
        public HasherEventArgs(HasherEventReportType reportType,
                               int?streamCount,
                               int?streamCurrent,
                               long?processedBytes,
                               long?totalBytes)
        {
            // Make sure we didn't get handed some
            // bullshit parameter values on a platter
            if (streamCount != null && streamCount <= 0)
            {
                throw new ArgumentOutOfRangeException("streamCount", String.Format(exceptionMessageArgument, streamCount));
            }
            if (streamCurrent != null && streamCurrent <= 0)
            {
                throw new ArgumentOutOfRangeException("streamCurrent", String.Format(exceptionMessageArgument, streamCurrent));
            }
            if (processedBytes != null && processedBytes <= 0)
            {
                throw new ArgumentOutOfRangeException("processedBytes", String.Format(exceptionMessageArgument, streamCurrent));
            }
            if (totalBytes != null && totalBytes <= 0)
            {
                throw new ArgumentOutOfRangeException("totalBytes", String.Format(exceptionMessageArgument, totalBytes));
            }

            this.eventReportType      = reportType;
            this.totalStreamCount     = streamCount;
            this.currentStreamNumber  = streamCurrent;
            this.streamBytesProcessed = processedBytes;
            this.streamTotalBytes     = totalBytes;
        }
Beispiel #2
0
        public HasherEventArgs(HasherEventReportType reportType,
                               int? streamCount,
                               int? streamCurrent,
                               long? processedBytes,
                               long? totalBytes)
        {
            // Make sure we didn't get handed some
            // bullshit parameter values on a platter
            if (streamCount != null && streamCount <= 0) throw new ArgumentOutOfRangeException("streamCount", String.Format(exceptionMessageArgument, streamCount));
            if (streamCurrent!= null && streamCurrent <= 0) throw new ArgumentOutOfRangeException("streamCurrent", String.Format(exceptionMessageArgument, streamCurrent));
            if (processedBytes != null && processedBytes <= 0) throw new ArgumentOutOfRangeException("processedBytes", String.Format(exceptionMessageArgument, streamCurrent));
            if (totalBytes != null && totalBytes <= 0) throw new ArgumentOutOfRangeException("totalBytes", String.Format(exceptionMessageArgument, totalBytes));

            this.eventReportType = reportType;
            this.totalStreamCount = streamCount;
            this.currentStreamNumber = streamCurrent;
            this.streamBytesProcessed = processedBytes;
            this.streamTotalBytes = totalBytes;
        }