private void btnAddUser_Click(object sender, EventArgs e) { _dirty_flag = true; AddUserForm add_form = new AddUserForm(); if (add_form.ShowDialog() == DialogResult.OK) { if (_users == null) { _users = new EIBUsersConf(); } _users.List.Add(add_form.CurrentUser); UpdateListView(); } }
public static bool SetUsersList(EIBUsersConf users) { //write object into xml form MemoryStream ms = new MemoryStream(); XmlSerializer ser = new XmlSerializer(typeof(EIBUsersConf)); ser.Serialize(ms, users); //get the xml string string content = ASCIIEncoding.ASCII.GetString(ms.ToArray()); StreamReader sr = GetEIBResponse(ConsoleDefinitions.EIBServerUsersConf.EIB_SERVER_SET_USERS_CONF_CMD, content,false); if (sr != null && sr.ReadToEnd().Length == 0) { return true; } return false; }
void IRefreshable.Refresh() { _users = ConsoleAPI.GetUsersList(); UpdateListView(); }