Esempio n. 1
0
        public void InitializeCommands()
        {
            var serializer           = new MyJsonSerializer <IBindingListPrototype>();
            var notifySerializer     = new SerializeNotifyer <IBindingListPrototype>(serializer);
            var serializationCommand = new FormSerializationCommand(notifySerializer, currentForm);

            currentForm.InitializeCommands(new List <ICommand> {
                serializationCommand
            });
        }
Esempio n. 2
0
        public void InitializeCommands()
        {
            var serializer        = new MyJsonSerializer <IBindingListPrototype>();
            var loggingSerializer = new SerializerLogger <IBindingListPrototype>(serializer);
            var superSerializer   = new SerializeNotifyer <IBindingListPrototype>(loggingSerializer);

            var serializationCommand = new FormSerializationCommand(superSerializer, currentForm);


            var deserializer        = new MyJsonSerializer <IBindingListPrototype>();
            var loggingDeserializer = new SerializerLogger <IBindingListPrototype>(deserializer);

            var deserializationCommand = new FormDeserializationCommand(loggingDeserializer, currentForm);


            var mementoCommand = new MainMementoCommand(currentForm as MainForm);

            currentForm.InitializeCommands(new List <ICommand> {
                serializationCommand, deserializationCommand, mementoCommand
            });
        }