コード例 #1
0
ファイル: FormBuilder.cs プロジェクト: Evgh/s4-oop-2
        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
            });
        }
コード例 #2
0
ファイル: FormBuilder.cs プロジェクト: Evgh/s4-oop-2
        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
            });
        }