示例#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;
         }
     }
 }