Exemple #1
0
        public RateItController()
        {
            MtCloudApplicationInitializer.EditorController.ActiveDocumentChanged += EditorController_ActiveDocumentChanged;

            MtCloudApplicationInitializer.Subscribe <TranslationProviderStatusChanged>(Settings_TranslationProviderStatusChanged);
            MtCloudApplicationInitializer.Subscribe <TranslationProviderRateItOptionsChanged>(TranslationProviderRateItOptionsChanged);
            MtCloudApplicationInitializer.Subscribe <TranslationProviderAdded>(TranslationProviderAdded);
        }
Exemple #2
0
        public MetadataSupervisor(ISegmentMetadataCreator segmentMetadataCreator, EditorController editorController)
        {
            _segmentMetadataCreator = segmentMetadataCreator;
            _editorController       = editorController;

            MtCloudApplicationInitializer
            .Subscribe <RefreshQeStatus>(OnQeStatus);
        }
Exemple #3
0
        public MetadataSupervisor(ISegmentMetadataCreator segmentMetadataCreator, EditorController editorController)
        {
            _segmentMetadataCreator = segmentMetadataCreator;
            _editorController       = editorController;

            _providerNames = new List <string> {
                PluginResources.SDLMTCloud_Provider_Name, PluginResources.SDLMTCloud_Provider_OldName, PluginResources.SDLMTCloud_Provider_OldName2
            };

            _ = MtCloudApplicationInitializer
                .Subscribe <RefreshQeStatus>(OnQeStatus);
        }
        public AddDictionaryTermAction()
        {
            Enabled = false;
            //Because this object gets constructed before the EditorController has been initialized, we need to make sure that the subscription to the event happens only after the EditorController has had a chance to be initialized
            //We cannot do this in the MTAppInitializer because this object gets constructed even before MtAppInit.Execute() is called
            MtCloudApplicationInitializer.Subscribe <StudioWindowCreatedNotificationEvent>(
                _ => MtCloudApplicationInitializer.EditorController.ActiveDocumentChanged +=
                    (_, _) => EnableAction());

            MtCloudApplicationInitializer.Subscribe <TranslationProviderAdded>(_ => EnableAction(new TranslationProviderStatusChanged(null, true)));

            MtCloudApplicationInitializer.Subscribe <TranslationProviderStatusChanged>(EnableAction);
        }
Exemple #5
0
        public SdlMTCloudTranslationProvider(Uri uri, string translationProviderState, ITranslationService translationService,
                                             ILanguageProvider languageProvider)
        {
            Uri = uri;
            LanguageProvider   = languageProvider;
            TranslationService = translationService;
            _editorController  = MtCloudApplicationInitializer.EditorController;
            _rateItController  = MtCloudApplicationInitializer.RateItController;

            var projectsController = MtCloudApplicationInitializer.ProjectsController;

            if (projectsController is not null)
            {
                projectsController.CurrentProjectChanged -= ProjectsController_CurrentProjectChanged;
                projectsController.CurrentProjectChanged += ProjectsController_CurrentProjectChanged;
                _currentProject = projectsController.CurrentProject.GetProjectInfo();
            }

            LoadState(translationProviderState);
            ActivateRatingController();

            MtCloudApplicationInitializer.Subscribe <TranslationProviderStatusChanged>(Settings_TranslationProviderStatusChanged);
        }