Esempio n. 1
0
        public MainForm()
        {
            InitializeComponent();

            if (File.Exists("./config.json"))  // load config file if exists.
            {
                DBSP2ClassGen.dbhandler d = new DBSP2ClassGen.dbhandler();
                ConfigInfo ci             = new ConfigInfo();
                d.GetConfigInfo(ref ci);


                txtIP.Text           = ci.IP.ToString();
                txtPort.Text         = ci.port.ToString();
                txtUsername.Text     = ci.Username.ToString();
                txtPassword.Text     = ci.password.ToString();
                cbxDatabaseList.Text = ci.dbname.ToString();
                if (ci.adHocFilename != null)
                {
                    lblAdHoc.Text = ci.adHocFilename.ToString();
                }
            }
            AppDefaultDir = System.Environment.CurrentDirectory;
        }
Esempio n. 2
0
 public dbhandler()
 {
     IP = new StringBuilder();
     Port = new StringBuilder();
     Username = new StringBuilder();
     Password = new StringBuilder();
     dbname = new StringBuilder();
     ci = new ConfigInfo();
 }
Esempio n. 3
0
 public void GetConfigInfo(ref ConfigInfo ci)
 {
     string jsonText = LoadJson("./config.json");
     ci = JsonConvert.DeserializeObject<ConfigInfo>(jsonText);
 }
Esempio n. 4
0
        public void GetConfigInfo(ref ConfigInfo ci)
        {
            string jsonText = LoadJson("./config.json");

            ci = JsonConvert.DeserializeObject <ConfigInfo>(jsonText);
        }