public void annule(Memento memento) { MementoImpl mementoImplInstance = memento as MementoImpl; if (mementoImplInstance == null) { return; } options = mementoImplInstance.etat; }
public Memento ajouteOption(OptionVehicule optionVehicule) { MementoImpl resultat = new MementoImpl(); resultat.etat = options; IList <OptionVehicule> optionsIncompatibles = optionVehicule.optionsIncompatibles; foreach (OptionVehicule option in optionsIncompatibles) { options.Remove(option); } options.Add(optionVehicule); return(resultat); }