Example #1
0
        /// <summary>
        /// Atidaro nustatymų langą, ir paskui perskaito duomenis iš json failo
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void nustatymaiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            settingsForm newform = new settingsForm();

            newform.ShowDialog();

            //Nuskaitis duomenus is json failo, kurie reikalingi jungiantis prie DB
            using (StreamReader r = new StreamReader("../../Properties/settings.json"))
            {
                //Sukuriama nauja parametru klase
                SettingsClass settingsObj = new SettingsClass();
                //Nuskaitomas failas kaip stringas
                string json = r.ReadToEnd();
                //Sitas metodas pavercia nuskaityta eilute i reikiama objekta
                deserializedSettings = JsonConvert.DeserializeObject <SettingsClass>(json);

                databaseConnection = new MySqlConnection(parameters());
            }
        }
Example #2
0
        private void nustatymai_Click(object sender, EventArgs e)
        {
            settingsForm form = new settingsForm();

            form.ShowDialog();
        }