示例#1
0
        /// <summary>
        /// Handles the Click event of the btnSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            DBLogonInfo obj;
            try
            {
                obj = new DBLogonInfo(
                    txtApplicationId.Text.Trim(),
                    txtProvider.Text.Trim(),
                    CreateConnectionString());
            }
            catch (ArgumentNullException ex)
            {
                MessageBox.Show(ex.Message,
                                @"Warning!",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return;
            }

            using (var xml =
                new XmlConfiguration(obj))
                if (xml.Write())
                {
                    ClearForm();
                }
        }
示例#2
0
 /// <summary>
 /// Constructor #1
 /// </summary>
 /// <param name="dbLogonInfo">DBLogonInfo</param>
 public XmlConfiguration(
     DBLogonInfo dbLogonInfo)
 {
     _dbLogonInfo = dbLogonInfo;
 }