Betzalel.SimpleMulticastAnalyzer.Statistics.StartPrintStatistics C# (CSharp) Метод

StartPrintStatistics() публичный Метод

public StartPrintStatistics ( DirectionTypes directionType ) : void
directionType DirectionTypes
Результат void
        public void StartPrintStatistics(DirectionTypes directionType)
        {
            _directionType = directionType;

              switch (directionType)
              {
            case DirectionTypes.Sender:
              _log.Info(GetSenderSummaryHeader());
              break;
            case DirectionTypes.Receiver:
              _log.Info(GetReceiverSummaryHeader());
              break;
            default:
              throw new ArgumentOutOfRangeException("directionType");
              }

              _printStatisticsTimer = new Timer(PrintStatisticsTask, this, 1000, 1000);
        }

Usage Example

Пример #1
0
        static void Main(string[] args)
        {
            var log        = new Log();
            var statistics = new Statistics(log);

            var programConfiguration = new ProgramConfiguration();

            if (!programConfiguration.Initialize(args))
            {
                return;
            }

            log.IsVerbose = programConfiguration.IsVerbose;

            INetworkNode networkNode;

            switch (programConfiguration.Direction)
            {
            case DirectionTypes.Sender:
            {
                networkNode = new Sender(log, statistics, programConfiguration);

                log.Info("Application initialized - press Escape to exit.");
            }
            break;

            case DirectionTypes.Receiver:
            {
                networkNode = new Receiver(log, statistics, programConfiguration);

                log.Info("Application initialized - press Escape to exit.");
            }
            break;

            default:
                throw new Exception("Invalid network node direction.");
            }

            networkNode.Start();
            statistics.StartPrintStatistics(programConfiguration.Direction);

            while (Console.ReadKey(true).Key != ConsoleKey.Escape)
            {
            }

            log.Info("Application shutting down...");
        }
All Usage Examples Of Betzalel.SimpleMulticastAnalyzer.Statistics::StartPrintStatistics