public ServerConnection(ClientConfiguration configuration) { encoding = Encoding.GetEncoding(1251); this.clientConfiguration = configuration; converter = new JsonConverter(); }
public FormReadExperiment() { InitializeComponent(); ClientConfiguration configuration = new ClientConfiguration(FileName.CONFIGURATION_CLIENT); notificationRecorder = new AnswerRecorder(FileName.RESULTS_EXPERIMENT_NOTIFICATIONS, " "); experimentRecorder = new AnswerRecorder(FileName.RESULTS_EXPERIMENT, " "); experimentNotificationWatch = new Stopwatch(); experimentNotificationWatch.Start(); Console.WriteLine("start!"); startTimer = new System.Windows.Forms.Timer(); startTimer.Interval = configuration.GetNotificationFlashTime(); startTimer.Tick += new EventHandler(StartTimerTick); notificationTimer = new System.Windows.Forms.Timer(); notificationTimer.Interval = configuration.GetNotificationPauseTime() + configuration.GetNotificationFlashTime(); notificationTimer.Tick += new EventHandler(NotificationTimerTick); ExperimentReader reader = new ExperimentReader(); experimentIterations = reader.GetExperimentData(); serverConnection = new ServerConnection(configuration); serverConnection.Register(FileName.UID.ToString()); notificationsService = new NotificationsService(); notificationsService.Daemonize(); colors = new ColorsList(); animator = new Animator(); feedbackLayout.BackColor = Color.LIGHT_ORANGE; roundNotificationWatch = new Stopwatch(); currentIteration = 0; omniumQuantity = 0; nextBtn.Enabled = true; PerformIteration(); }