public MainWindow()
 {
     InitializeComponent();
     service = Service.getInstance();
     AddHotKeys();
     DefaultConnectionFromFile();
 }
 public WizardPage2(String initString)
 {
     InitializeComponent();
     this.initString = initString;
     this.service = Service.getInstance();
     AddHotKeys();
 }
 public WizardPage3(String initString, WizardPage2 wiz2)
 {
     this.service = Service.getInstance();
     InitializeComponent();
     mezok[0] = initString;
     this.initString = initString;
     this.wiz2 = wiz2;
     AddHotKeys();
     FillCmbbxs();
 }
        private void DefaultConnectionFromFile()
        {
            if (File.Exists("adatb-kapcs.adb"))
            {

                ConnectionArrayList conns = new ConnectionArrayList();
                //Open the file written above and read values from it.
                Stream stream = File.Open("adatb-kapcs.adb", FileMode.Open);
                BinaryFormatter bformatter = new BinaryFormatter();

                conns = (ConnectionArrayList)bformatter.Deserialize(stream);
                stream.Close();

                foreach (Connection con in conns.Conns)
                {
                    if (con.IsDefault) {
                        this.service = Service.getInstance();
                        service.ConnectionString = "server=" +
                           con.Url + ";user="******";database=tkis;port=3306;password="******";Charset=utf8;"
                           ;
                        CmbbxFillMySQL();
                    }
                }

            }
        }
Exemple #5
0
 public static Service getInstance()
 {
     if (service == null)
         service = new Service();
     return service;
 }
Exemple #6
0
        private void send_Click(object sender, RoutedEventArgs e)
        {
            if (cmbBxConnectionSelector.SelectedItem != null)
            {
                foreach (Connection con in this.connections.Conns) {
                    con.IsDefault = false;
                }

                ((Connection)this.cmbBxConnectionSelector.SelectedItem).IsDefault = true;
                this.service = Service.getInstance();
                service.ConnectionString = "server=" +
                    ((Connection)this.cmbBxConnectionSelector.SelectedItem).Url + ";user="******";database=tkis;port=3306;password="******";Charset=utf8;"
                    ;
                SaveToFile();
                this.Close();
            }
            else
                MessageBox.Show("Először válasszon egy csatlakozási lehetőséget a legördülő menüből!", "Nincs kapcsolat kiválasztva", MessageBoxButton.OK, MessageBoxImage.Information);
        }