public static PWParty CreateParty(PWClient client) { PWParty party = new PWParty(client); Partys.Add(party); OnPartyCreated?.Invoke(null, party); return(party); }
public void ToggleCuenta(PWClient client) { if (this.Cuentas.Contains(client)) { this.Cuentas.Remove(client); } else { this.Cuentas.Add(client); } if (this.Cuentas.Count == 0) { BLL.ClientManager.RemoveParty(this); } }
private static PWClient GetClient(Process proc, DTO.Configuration.Cuenta config) { var dbConfig = DAL.CuentaConfig.Get(config.Name ?? config.Login) ?? new DAL.CuentaConfig() { Id = Guid.NewGuid(), Login = config.Name ?? config.Login }; var cuenta = new PWClient(proc, config, dbConfig); cuenta.Manager.SetWindowTitle(config.Name ?? config.Login); lock (Cuentas) Cuentas.Add(cuenta); cuenta.OnDisposing += (sender, c) => { lock (Cuentas) if (Cuentas.Contains(c)) { Cuentas.Remove(c); } }; return(cuenta); }
public PWParty(PWClient client) { ToggleCuenta(client); }