示例#1
0
        public void annule(Memento memento)
        {
            MementoImpl mementoImplInstance = memento as MementoImpl;

            if (mementoImplInstance == null)
            {
                return;
            }
            options = mementoImplInstance.etat;
        }
示例#2
0
        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);
        }