示例#1
0
        /// <summary>
        /// Initialize the adapter services
        /// </summary>
        /// <param name="analysisServiceContainer"></param>
        public void InitializeServices(IServiceContainer analysisServiceContainer)
        {
            m_analysisServiceContainer = analysisServiceContainer;

            m_changeGroupService = (ChangeGroupService)m_analysisServiceContainer.GetService(typeof(ChangeGroupService));
            Debug.Assert(m_changeGroupService != null, "Change group service is not initialized");

            m_changeGroupService.RegisterDefaultSourceSerializer(new ClearQuestRecordItemSerializer());
            //m_changeGroupService.RegisterSourceSerializer(
            //    WellKnownChangeActionId.SyncContext, new WorkItemContextSyncMigrationItemSerializer());
            m_changeGroupService.RegisterSourceSerializer(
                WellKnownChangeActionId.AddAttachment, new ClearQuestAttachmentItemSerializer());
            m_changeGroupService.RegisterSourceSerializer(
                WellKnownChangeActionId.DelAttachment, new ClearQuestAttachmentItemSerializer());

            m_configurationService = (ConfigurationService)m_analysisServiceContainer.GetService(typeof(ConfigurationService));
            Debug.Assert(m_configurationService != null, "Configuration service is not initialized");

            m_conflictManagerService = m_analysisServiceContainer.GetService(typeof(ConflictManager)) as ConflictManager;

            m_hwmDelta = new HighWaterMark <DateTime>(ClearQuestConstants.CqRecordHwm);
            m_configurationService.RegisterHighWaterMarkWithSession(m_hwmDelta);
        }
        public void InitializeServices(IServiceContainer migrationServiceContainer)
        {
            m_migrationServiceContainer = migrationServiceContainer;

            m_changeGroupService = (ChangeGroupService)m_migrationServiceContainer.GetService(typeof(ChangeGroupService));
            Debug.Assert(m_changeGroupService != null, "Change group service is not initialized");

            m_changeGroupService.RegisterDefaultSourceSerializer(new ClearQuestRecordItemSerializer());
            //m_changeGroupService.RegisterSourceSerializer(
            //    WellKnownChangeActionId.SyncContext, new WorkItemContextSyncMigrationItemSerializer());
            m_changeGroupService.RegisterSourceSerializer(
                WellKnownChangeActionId.AddAttachment, new ClearQuestAttachmentItemSerializer());
            m_changeGroupService.RegisterSourceSerializer(
                WellKnownChangeActionId.DelAttachment, new ClearQuestAttachmentItemSerializer());

            m_configurationService = (ConfigurationService)m_migrationServiceContainer.GetService(typeof(ConfigurationService));
            Debug.Assert(m_configurationService != null, "Configuration service is not initialized");

            m_commentDecorationService = (ICommentDecorationService)m_migrationServiceContainer.GetService(typeof(ICommentDecorationService));
            Debug.Assert(m_commentDecorationService != null, "Comment decoration service is not initialized");

            m_conflictManagerService = migrationServiceContainer.GetService(typeof(ConflictManager)) as ConflictManager;
        }