Пример #1
0
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                Candidate newFact = new Candidate(memento);

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

                return newFact;
            }
Пример #2
0
 // Business constructor
 public Offer(
     Turn turn
     ,Candidate candidate
     ,int chances
     )
 {
     InitializeResults();
     _turn = new PredecessorObj<Turn>(this, RoleTurn, turn);
     _candidate = new PredecessorObj<Candidate>(this, RoleCandidate, candidate);
     _chances = chances;
 }