private void SetData(DTO.GlobalConfigs.Ambiente item = null) { item = item ?? new DTO.GlobalConfigs.Ambiente(); tGCBADataName.Text = item.Name; tGCBAWebIP.Text = item.WebServerIP; cbGCBAWebAllowExplorer.Checked = item.AllowExplorer; cbGCBAWebAllowRemote.Checked = item.AllowRemote; cbGCBAUseCustomUser.Checked = item.UseCustomUser; tGCBACustomUser.Text = item.CustomUser; tGCBACustomPass.Text = item.CustomPass; this.SelectedItem = item; this.WebList = item.Webs.Select(p => p.Clone()).ToList(); ReLoadDataWebs(); }
private void ReLoadData(DTO.GlobalConfigs.Ambiente autoselect = null) { lbGCBAAmbientes.Items.Clear(); lbGCBAAmbientes.Items.AddRange(Config.Global.Ambientes.Where(p => p.Name.ToUpper().Contains(tGCBAFilter.Text.ToUpper())).OrderBy(p => p.Name).ToArray()); if (autoselect != null && lbGCBAAmbientes.Items.Contains(autoselect)) { lbGCBAAmbientes.SelectedItem = autoselect; } else if (lbGCBAAmbientes.Items.Count > 0) { lbGCBAAmbientes.SelectedIndex = 0; } else { SetData(); } }