Exemplo n.º 1
0
        /// <summary>
        /// Get the saved language mapping settings from current project
        /// </summary>
        public LanguageMappingSettings GetLanguageMappingSettings()
        {
            var currentProject  = GetCurrentProject() ?? AppInitializer.GetFileController()?.CurrentProject;
            var projectSettings = currentProject?.GetSettings();

            if (projectSettings != null)
            {
                var containsSettingsGroup = projectSettings.ContainsSettingsGroup(Constants.SettingsGrId);

                _sdlMTCloudSettingsGroup = projectSettings.GetSettingsGroup(Constants.SettingsGrId);

                if (!containsSettingsGroup)
                {
                    projectSettings.AddSettingsGroup(_sdlMTCloudSettingsGroup);
                }
                var savedMappingSettings = projectSettings.GetSettingsGroup <LanguageMappingSettings>(Constants.SettingsGrId);
                return(savedMappingSettings);
            }
            return(null);
        }