public MainForm() { InitializeComponent(); Console.WriteLine(); comboBox1.SelectedItem = comboBox1.Items[0]; experimentInfoHandler = new ConfigDataXMLSerializer <ExperimentInfo>(baseFolder + experimentInfoFile); experimentInfoHandler.GetConfigs(out experimentInfo); if (experimentInfo == null) { experimentInfo = new ExperimentInfo(); experimentInfo.header = String.Empty; experimentInfo.paragraphs = new string[] { "" }; experimentInfoHandler.SaveConfigData(ref experimentInfo); } label2.Text = experimentInfo.header; richTextBox1.Clear(); foreach (string p in experimentInfo.paragraphs) { richTextBox1.Text += " " + p + Environment.NewLine; } expForm = new ExperimentForm(); }
void InitSettings() { // instantiate the eye tracking controller eyeTrackingController = new EyeTrackingController.EyeTrackingController(); // define callbacks for data stream sampleCallback = new GetSampleCallback(GetSampleCallbackFunction); eyeTrackingController.iV_SetSampleCallback(sampleCallback); backgroundWorker = new BackgroundWorker(); backgroundWorker.WorkerReportsProgress = true; backgroundWorker.DoWork += new DoWorkEventHandler(CheckEyeTrackerStatus); backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(StartEyeTracker); backgroundWorker.RunWorkerAsync(); Utils.AddDirectorySecurity(configPath, Environment.UserDomainName + "\\" + Environment.UserName, System.Security.AccessControl.FileSystemRights.FullControl, System.Security.AccessControl.AccessControlType.Allow); experimentLogHandler = new ConfigDataXMLSerializer <ExperimentLog>(configPath + settingsFile); experimentLogHandler.GetConfigs(out experimentLogs); if (experimentLogs == null) { experimentLogs = new ExperimentLog(0); } LoadImages(); pictureBox.Location = new Point(this.Width / 2 - pictureBox.Width / 2, this.Height / 2 - (int)(pictureBox.Height * (float)(0.8))); flowLayoutPanel2.Location = new Point(this.Width / 2 - flowLayoutPanel2.Width / 2, this.Height - flowLayoutPanel2.Height - panel1.Height * 3); panel1.Location = new Point(this.Width / 2 - panel1.Width / 2, this.Height - panel1.Height * 4); groupBox1.Location = new Point(this.Width / 2 - groupBox1.Width / 2, (this.Height - groupBox1.Height) / 2); groupBox1.Visible = false; }