public bool Activate(SmartMenu smartMenu) { string description = string.Format( "{0}\n{1}\n{2}\n{3}\n{4}", Expenditure.Title, Expenditure.ExpenseType, Expenditure.Cash, Expenditure.Date, Expenditure.Amount ); SmartMenu sm = new SmartMenu(Expenditure.Title, "Tilbage", description); sm.Attach(new RemoveExpense(Compensation, Expenditure)); int countExpenses = Compensation.CountAppendices(); sm.Activate(); if (countExpenses > Compensation.CountAppendices()) { smartMenu.Detach(this); } return(false); }
public bool Activate(SmartMenu smartMenu) { string description = string.Format( "{0}\n{1}\n{2}\n{3}\n{4}\n{5}", trip.Title, trip.DepartureDestination, trip.DepartureDate, trip.ArrivalDestination, trip.ArrivalDate, trip.Distance ); SmartMenu sm = new SmartMenu(trip.Title, "Tilbage", description); sm.Attach(new RemoveExpense(Compensation, trip)); int countExpenses = Compensation.CountAppendices(); sm.Activate(); if (countExpenses > Compensation.CountAppendices()) { smartMenu.Detach(this); } return(false); }