Пример #1
0
 public void GenerateSequence()
 {
     lock (syncRoot) {
         var typeToExistsMap = new Dictionary<string, bool>();
         foreach (object item in Session.GetObjectsToSave())
             typeToExistsMap[Session.GetClassInfo(item).FullName] = true;
         if (sequenceGenerator == null)
             sequenceGenerator = new SequenceGenerator(typeToExistsMap);
         SubscribeToEvents();
         OnSequenceGenerated(sequenceGenerator.GetNextSequence(ClassInfo));
     }
 }
Пример #2
0
 void CancelSequence()
 {
     lock (syncRoot) {
         UnSubscribeFromEvents();
         if (sequenceGenerator != null) {
             sequenceGenerator.Close();
             sequenceGenerator = null;
         }
     }
 }