예제 #1
0
 public void propertiesConstructorTest()
 {
     properties target = new properties();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
예제 #2
0
 private void toolStripButton7_Click(object sender, EventArgs e)
 {
     try
     {
         properties dlg = new properties();
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             // Read the contents of testDialog's TextBox.
             settingsData.server = dlg.serverName.Text;
             settingsData.dbname = dlg.dbName.Text;
             settingsData.dbuser = dlg.dbuser.Text;
             settingsData.dbpass = dlg.dbpass.Text;
             settingsData.dbPort = dlg.dbPort.Text;
             FileStream f = new FileStream("properties.xml", FileMode.Create);
             XmlTextWriter settings = new XmlTextWriter(f, Encoding.Default);
             settings.WriteStartDocument();
             settings.WriteStartElement("server");
             addAtributeToXml(settings, "servername", settingsData.server);
             addAtributeToXml(settings, "dbname", settingsData.dbname);
             addAtributeToXml(settings, "dbuser", settingsData.dbuser);
             addAtributeToXml(settings, "dbpass", settingsData.dbpass);
             addAtributeToXml(settings, "dbPort", settingsData.dbPort);
             settings.WriteEndElement();
             settings.WriteEndDocument();
             settings.Close();
             f.Close();
         }
         dlg.Dispose();
     }
     catch (Exception except)
     {
         MessageBox.Show(except.Message);
     }
 }