internal void Initialize(int sessionRunId) { m_session.Initialize(sessionRunId); using (RuntimeEntityModel context = RuntimeEntityModel.CreateInstance()) { RTSessionRun sessionRun = context.RTSessionRunSet.Where (sr => sr.Id == m_session.InternalSessionRunId).First(); Debug.Assert(sessionRun != null, "Cannot find session run in the Tfs Migration DB"); sessionRun.ConflictCollectionReference.Load(); // finishing the conflict manager initialization by assigning the current // ConflictCollection Id to them foreach (var serviceContainer in this.m_serviceContainers.Values) { ConflictManager conflictManager = serviceContainer.GetService(typeof(ConflictManager)) as ConflictManager; Debug.Assert(null != conflictManager, "null == conflictManager"); conflictManager.InitializePhase2(sessionRun.ConflictCollection.Id); } } foreach (KeyValuePair <Guid, IMigrationProvider> provider in m_migrationProviders) { try { provider.Value.InitializeClient(); } catch (Exception e) { ConflictManager manager = m_serviceContainers[provider.Key].GetService(typeof(ConflictManager)) as ConflictManager; ErrorManager.TryHandleException(e, manager); } } }
/// <summary> /// Heavier-weight Phase2 initialization /// </summary> /// <param name="sessionRunId"></param> internal void Initialize(int sessionRunId, ISessionOrchestrator sessionOrchestrator) { m_session.Initialize(sessionRunId); using (RuntimeEntityModel context = RuntimeEntityModel.CreateInstance()) { RTSessionRun sessionRun = context.RTSessionRunSet.Where (sr => sr.Id == m_session.InternalSessionRunId).First(); Debug.Assert(sessionRun != null, "Cannot find session run in the Tfs Migration DB"); sessionRun.ConflictCollectionReference.Load(); // finishing the conflict manager initialization by assigning the current // ConflictCollection Id to them foreach (var serviceContainer in this.m_serviceContainers.Values) { ConflictManager conflictManager = serviceContainer.GetService(typeof(ConflictManager)) as ConflictManager; Debug.Assert(null != conflictManager, "null == conflictManager"); conflictManager.InitializePhase2(sessionRun.ConflictCollection.Id); } } foreach (var provider in m_analysisProviders.Values) { provider.InitializeClient(); } }