<commit_before>﻿using PgEdit.Domain;
using PgEdit.Service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PgEdit
{
    public partial class frmConnection : Form
    {
        // Test connection colors
        private readonly Color COLOR_SUCCESS = Color.Green;
        private readonly Color COLOR_FAIL = Color.Red;
        private readonly Color COLOR_UNKNOWN = Color.Gray;

        private Server server;
        private Database database;
        private SshTunnel sshTunnel;

        private Universe universe;

        private bool viewMode;

        /// <summary>
        /// For Windows Forms Designer only. 
        /// Use ctor with parameters.<commit_msg>add comments for frmConnection<commit_after>﻿using PgEdit.Domain;
using PgEdit.Service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PgEdit
{
    /// <summary>
    /// Creates or views database connections
    /// </summary>
    /// <remarks>
    /// Bird eye view:
    /// This form used in 2 scenarios: creating new connection settings and viewing existing connection settings (see constructors for more info).
    /// 
    /// In 'create new connection' mode frmConnection_Load method creates new server, database and sshTunnel domain objects and binds it to controls.
    /// Changing contols by user changes domain object's properties.
    /// When user click OK validation function check settings and if its OK then dialog closes with 'DialogResult.OK'.
    /// Then newly created domain objects can be obtained via public propery 'Server'.
    /// 
    /// In 'view connection' mode corresponded domain object passed to form via constructor and binds to controls just as it in 'create new connection' mode.
    /// All editing controls disables exept check connection buttons.
    /// So use can't change anything.
    /// It this scenario 'DialogResult.OK' and frmConnection.Server property should be ignored
    /// </remarks>
    public partial class frmConnection : Form
    {
        // Test connection colors
        private readonly Color COLOR_SUCCESS = Color.Green;
        private readonly Color COLOR_FAIL = Color.Red;
        private readonly Color COLOR_UNKNOWN = Color.Gray;

        private Server server;
        private Database database;
        private SshTunnel sshTunnel;

        private Universe universe;

        private bool viewMode;

        /// <summary>
        /// For Windows Forms Designer only. 
        /// Use ctor with parameters.
{'fraction_non_alphanumeric': 0.07590066456803078, 'fraction_numerical': 0.0003497726477789437, 'mean_word_length': 2.8700947225981057, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4190729', 'n_tokens_mistral': 715, 'n_tokens_neox': 698, 'n_words': 286}