Beispiel #1
0
        public void Save()
        {
            ValidateAssemblies();

            var pw = Password;

            if (!string.IsNullOrWhiteSpace(Password))
            {
                Password = CxInfo.Encrypt(Password);
            }

            try
            {
                var json = JsonConvert.SerializeObject(this);
                CxInfo.DriverData.SetElementValue(RavenConnectionInfoKey, json);
            }
            catch (Exception ex)
            {
                // mvvm.... screw it again
                MessageBox.Show(string.Format(
                                    "Exception serializing JSON: {0}{1}",
                                    Environment.NewLine,
                                    ex.Message));

                // we don't want linqpad to continue if this happens so throw the exception
                throw;
            }

            Password = pw;
        }
        public void Save()
        {
            ValidateAssemblies();

            var pw = Password;

            if (!string.IsNullOrWhiteSpace(Password))
            {
                Password = CxInfo.Encrypt(Password);
            }

            var json = JsonConvert.SerializeObject(this);

            CxInfo.DriverData.SetElementValue(RavenConnectionInfoKey, json);

            Password = pw;
        }