public override void DoMemento(TextWriterMemento memento)
 {
     foreach (string str in memento.Written)
     {
         this._writer.Write(str);
     }
 }
예제 #2
0
 public override void DoMemento(TextWriterMemento memento)
 {
     foreach (var written in memento.Written)
     {
         _writer.Write(written);
     }
 }
        public CacheMemento EndMemento()
        {
            CacheMemento memento = new CacheMemento();

            if (this._priorOutput != null)
            {
                this._spoolOutput.WriteTo(this._priorOutput);
                this._state.Output  = this._priorOutput;
                memento.SpoolOutput = this._spoolOutput;
            }
            foreach (KeyValuePair <string, TextWriterOriginator> pair in this._priorContent)
            {
                TextWriterMemento memento2 = pair.Value.EndMemento();
                if (memento2.Written.Any <string>(part => !string.IsNullOrEmpty(part)))
                {
                    memento.Content.Add(pair.Key, memento2);
                }
            }
            foreach (KeyValuePair <string, TextWriter> pair2 in from kv in this._state.Content
                     where !this._priorContent.ContainsKey(kv.Key)
                     select kv)
            {
                TextWriterOriginator originator = TextWriterOriginator.Create(pair2.Value);
                memento.Content.Add(pair2.Key, originator.CreateMemento());
            }
            IEnumerable <KeyValuePair <string, string> > source = from once in this._state.OnceTable
                                                                  where !this._priorOnceTable.ContainsKey(once.Key)
                                                                  select once;

            memento.OnceTable = source.ToDictionary <KeyValuePair <string, string>, string, string>(once => once.Key, once => once.Value);
            return(memento);
        }
예제 #4
0
 public abstract void DoMemento(TextWriterMemento memento);
예제 #5
0
 public override void DoMemento(TextWriterMemento memento)
 {
     foreach (var written in memento.Written)
         _writer.Write(written);
 }
예제 #6
0
 public abstract void DoMemento(TextWriterMemento memento);