예제 #1
0
        /// <summary>
        /// Initialize method.
        /// </summary>
        public void InitializeServices(IServiceContainer migrationServiceContainer)
        {
            m_migrationServiceContainer = migrationServiceContainer;
            m_changeGroupService        = (ChangeGroupService)m_migrationServiceContainer.GetService(typeof(ChangeGroupService));
            if (m_alternativeSerializer == null)
            {
                m_changeGroupService.RegisterDefaultSourceSerializer(new ClearCaseV6MigrationItemSerialzier());
            }
            else
            {
                m_changeGroupService.RegisterDefaultSourceSerializer(m_alternativeSerializer);
            }
            Debug.Assert(m_changeGroupService != null, "Change group service is not initialized");
            m_configurationService = (ConfigurationService)m_migrationServiceContainer.GetService(typeof(ConfigurationService));
            Debug.Assert(m_configurationService != null, "Configuration service is not initialized");
            m_eventService             = (EventService)m_migrationServiceContainer.GetService(typeof(EventService));
            m_commentDecorationService = (ICommentDecorationService)m_migrationServiceContainer.GetService(typeof(ICommentDecorationService));
            Debug.Assert(m_commentDecorationService != null, "Comment decoration service is not initialized");
            m_changeGroupHighWaterMark = new HighWaterMark <long>("LastChangeGroupMigratedHighWaterMark");
            m_configurationService.RegisterHighWaterMarkWithSession(m_changeGroupHighWaterMark);
            if (m_hwmLastSyncedTfsChangeset != null)
            {
                m_configurationService.RegisterHighWaterMarkWithSession(m_hwmLastSyncedTfsChangeset);
            }

            foreach (BusinessModel.VC.Setting setting in m_configurationService.VcCustomSetting.Settings.Setting)
            {
                if (string.Equals(
                        setting.SettingKey, MigrationToolkitResources.VCSetting_DisableTargetAnalysis, StringComparison.OrdinalIgnoreCase))
                {
                    if (string.Equals(setting.SettingValue, "True", StringComparison.OrdinalIgnoreCase))
                    {
                        m_overrideTargetChange = true;
                        break;
                    }
                }
            }
        }
        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;
        }