Ejemplo n.º 1
0
        private static string BuildMessage(StaticticsInfo staticticsInfo)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(" Files processed: " + staticticsInfo.FilesProcessed + " from "
                      + staticticsInfo.FilesGeneral + " total,");
            sb.Append("\n Files left: " + staticticsInfo.FilesLeft);

            return(sb.ToString());
        }
Ejemplo n.º 2
0
        private static string BuildFinalStatisticsMessage(StaticticsInfo staticticsInfo)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("\n\n Operation completed.");
            sb.Append("\n Files processed: " + staticticsInfo.FilesProcessed + " from "
                      + staticticsInfo.FilesGeneral + " total,");
            sb.Append("\n Operetion duration: " + staticticsInfo.OperationDuration.ToString(@"hh\:mm\:ss"));

            return(sb.ToString());
        }
Ejemplo n.º 3
0
        public void TraceLog(StaticticsInfo staticticsInfo)
        {
            string message = string.Empty;

            if (!staticticsInfo.IsOperationCompleted)
            {
                message = BuildMessage(staticticsInfo);
            }
            else
            {
                message = BuildFinalStatisticsMessage(staticticsInfo);
            }


            Console.WriteLine(message);
        }