Example #1
0
        /// <summary>
        /// Prepare any Data before Update is started.
        /// </summary>
        private void PrepareDataBeforeUpdate()
        {
            try
            {
                var sw = new StringWriter();
                Settings.WriteXml(sw);

                FormSettingsRow userSettingsRow;
                if (_createFormSettings)
                {
                    userSettingsRow          = FormSettings.NewFormSettingsRow();
                    userSettingsRow.UserName = _userName;
                    userSettingsRow.FormName = _formName;
                }
                else
                {
                    userSettingsRow = FormSettings.FindByUserNameFormName(_userName, _formName);
                }

                userSettingsRow.FormSettingsXml = sw.ToString();

                if (_createFormSettings)
                {
                    FormSettings.Rows.Add(userSettingsRow);
                }
            }
            catch
            {
                throw new Exception("There was an error with the KeyValuePairs Xml.");
            }
        }