protected virtual bool DoEquipment(string rawParameters, params CommandParameter[] parameters) { Send("You are using:"); if (Equipments.All(x => x.Item == null)) { Send("Nothing"); } else { StringBuilder sb = new StringBuilder(); //foreach (EquipedItem equipedItem in Equipments.Where(x => x.Item != null)) foreach (EquipedItem equipedItem in Equipments) { string where = EquipmentSlotsToString(equipedItem.Slot); sb.Append(where); //sb.AppendLine(FormatItem(equipedItem.Item, true)); if (equipedItem.Item == null) { sb.AppendLine("nothing"); } else { sb.AppendLine(FormatItem(equipedItem.Item, true)); } } Send(sb); } return(true); }
private void OnToggleAll() { bool allChecked = Equipments.All(x => x.IsPossessed); foreach (EquipmentViewModel equipment in Equipments) { equipment.IsPossessed = allChecked == false; } }
protected override bool OnSaveCanExecute() { return(HasChanges && Equipments.All(m => !m.HasErrors)); }