本文整理汇总了C#中System.Form1.startSurvey方法的典型用法代码示例。如果您正苦于以下问题:C# Form1.startSurvey方法的具体用法?C# Form1.startSurvey怎么用?C# Form1.startSurvey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Form1
的用法示例。
在下文中一共展示了Form1.startSurvey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button2_Click
//.........这里部分代码省略.........
}
//check that the xml file exists
if (!File.Exists(xmlFilePath))
{
errorBox.setLabel("Error: Cannot find expected configuration file:" + xmlFilePath);
errorBox.ShowDialog();
return;
}
//participantID
string partID = selectedPart.getID();
//has the user set the GPS baud rate, port and the main data dir ?
portNum = (string)comboBox1.SelectedItem;
baudRate = (string)comboBox2.SelectedItem;
gpsCountry = (string)comboBox3.SelectedItem;
if (portNum == null && Utils.GPSenabled)
{
errorBox.setLabel("Error: Please set the GPS port Number (settings)");
errorBox.ShowDialog();
return;
}
if (baudRate == null && Utils.GPSenabled)
{
errorBox.setLabel("Error: Please set the GPS baudrate (settings)");
errorBox.ShowDialog();
return;
}
if (gpsCountry == null && Utils.GPSenabled)
{
errorBox.setLabel("Error: Please set the GPS country (settings)");
errorBox.ShowDialog();
return;
}
//check that this participant does not already exist, i.e. that the new datadir does not exist
string partDataDir = selectedPart.getPath();
//turn off the GPS logger if on
/*
if (loggerStatus == "on")
{
//turn off until user exits the Q window
//disable the timer
timer1.Enabled = false;
//close the serial port
if (serialPort1.IsOpen)
{
serialPort1.Close();
}
label11.Text = "suspended while Questionnaire is open";
label12.Text = "suspended while Questionnaire is open";
loggerStatus = "suspended";
}
* */
//open the form
currentSurvey = new Form1();
try
{
//start the survey
currentSurvey.startSurvey(xmlFilePath, partDataDir, partID, false, portNum, baudRate, this, gpsCountry);
currentSurvey.Show();
qFormIsOpen = true;
openParticipantID = partID;
}
catch(ObjectDisposedException e2){
//something went wrong with startup, e.g. XML parsing exception
qFormIsOpen = false;
}
}
示例2: button1_Click
//.........这里部分代码省略.........
return;
}
if (baudRate == null && Utils.GPSenabled)
{
errorBox.setLabel("Error: Please set the GPS baudrate (settings)");
errorBox.ShowDialog();
return;
}
if (gpsCountry == null && Utils.GPSenabled)
{
errorBox.setLabel("Error: Please set the GPS country (settings)");
errorBox.ShowDialog();
return;
}
//check that this participant does not already exist, i.e. that the new datadir does not exist
string partDataDir = dataDir + "\\participant_data_" + language + "_" + partID;
if (Directory.Exists(partDataDir))
{
//user already exists
errorBox.setLabel("Error: This Participant already exists.");
errorBox.ShowDialog();
return;
}
//create the new dir.
try
{
Directory.CreateDirectory(partDataDir);
}
catch
{
errorBox.setLabel("Error: Could not create directory for this participant. You may not have permission to write to this location");
errorBox.ShowDialog();
return;
}
//if the logger is running: suspend it
//i.e. disconnect from the serial port
/*
if (loggerStatus == "on")
{
//turn off until user exits the Q window
//disable the timer
timer1.Enabled = false;
//close the serial port
if (serialPort1.IsOpen)
{
serialPort1.Close();
}
label11.Text = "suspended while Questionnaire is open";
label12.Text = "suspended while Questionnaire is open";
loggerStatus = "suspended";
}
* */
//open the form
currentSurvey = new Form1();
try
{
//start the survey
currentSurvey.startSurvey(xmlFilePath, partDataDir, partID, true, portNum, baudRate, this, gpsCountry);
currentSurvey.Show();
qFormIsOpen = true;
openParticipantID = partID;
}
catch (ObjectDisposedException e2)
{
//something went wrong with startup, e.g. XML parsing exception
qFormIsOpen = false;
}
}