Пример #1
0
 private void btnCastleConnection_Click(object sender, EventArgs e)
 {
     using (var dlg = new DiagnosticsCastleForm())
     {
         dlg.TxtCastleUrl.Text      = pluginSettings.DiagnosticsUrl != null ? pluginSettings.DiagnosticsUrl.AbsoluteUri : string.Empty;
         dlg.TxtCastleUsername.Text = pluginSettings.UserName;
         dlg.TxtCastlePassword.Text = pluginSettings.GetPassword();
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             pluginSettings.DiagnosticsUrl = new Uri(dlg.TxtCastleUrl.Text);
             pluginSettings.UserName       = dlg.TxtCastleUsername.Text;
             pluginSettings.SetPassword(dlg.TxtCastlePassword.Text);
         }
     }
 }
Пример #2
0
        private void CastleConnection_Click(object sender, EventArgs e)
        {
            using (var dlg = new DiagnosticsCastleForm())
            {
                var settings = PluginSettings.Load(plugin.PluginConfigurationFilePath);
                dlg.TxtCastleUrl.Text      = settings.DiagnosticsUrl != null ? settings.DiagnosticsUrl.AbsoluteUri : string.Empty;
                dlg.TxtCastleUsername.Text = settings.UserName;
                dlg.TxtCastlePassword.Text = settings.GetPassword();
                if (dlg.ShowDialog(FiddlerApplication.UI) == DialogResult.OK)
                {
                    settings.DiagnosticsUrl = new Uri(dlg.TxtCastleUrl.Text);
                    settings.UserName       = dlg.TxtCastleUsername.Text;
                    settings.SetPassword(dlg.TxtCastlePassword.Text);
                    settings.Save(plugin.PluginConfigurationFilePath);

                    plugin.ReloadSettings(settings);

                    PrepareServerMenu();
                }
            }
        }