Example #1
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                ThoughtText newFact = new ThoughtText(memento);

                // Create a memory stream from the memento data.
                using (MemoryStream data = new MemoryStream(memento.Data))
                {
                    using (BinaryReader output = new BinaryReader(data))
                    {
                        newFact._value = (string)_fieldSerializerByType[typeof(string)].ReadData(output);
                    }
                }

                return(newFact);
            }
Example #2
0
            public void WriteFactData(CorrespondenceFact obj, BinaryWriter output)
            {
                ThoughtText fact = (ThoughtText)obj;

                _fieldSerializerByType[typeof(string)].WriteData(output, fact._value);
            }
			public CorrespondenceFact CreateFact(FactMemento memento)
			{
				ThoughtText newFact = new ThoughtText(memento);

				// Create a memory stream from the memento data.
				using (MemoryStream data = new MemoryStream(memento.Data))
				{
					using (BinaryReader output = new BinaryReader(data))
					{
						newFact._value = (string)_fieldSerializerByType[typeof(string)].ReadData(output);
					}
				}

				return newFact;
			}