Exemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     SubSonicServer server = new SubSonicServer();
     int uid = lstServers.Items.Count + 1;
     server.Name = "DummyServer" + uid.ToString();
     servers.Add(server);
     RefreshList();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Create a list of all servers
        /// </summary>
        /// <returns>A list with servers</returns>
        public List<SubSonicServer> getServers()
        {
            List<SubSonicServer> servers = new List<SubSonicServer>();

            SQLiteResultSet results = db.Execute("SELECT * FROM servers");
            for (int i = 0; i < results.Rows.Count; i++) {
                SubSonicServer server = new SubSonicServer();
                //TODO make it more fault proof
                server.Name = results.Rows[i].fields[0];
                server.Address = results.Rows[i].fields[1];
                server.UserName = results.Rows[i].fields[2];
                server.Password = results.Rows[i].fields[3];
                servers.Add(server);
            }

            return servers;
        }
Exemplo n.º 3
0
 private SubSonicServer updateServer(SubSonicServer server)
 {
     //TODO Add checks on input
     server.Name = txtName.Text;
     if ((txtAddress.Text.ToLower()).Substring(0, 4) != "http") {
         txtAddress.Text = "http://" + txtAddress.Text;
     }
     server.Address = txtAddress.Text;
     server.UserName = txtUserName.Text;
     server.Password = txtPassword.Text;
     return server;
 }