Пример #1
0
        public static void ShowConfigWindow()
        {
            var configRepository = new EditorConfigRepository();

            var defaultExportUnit = new DefaultLocalizationExportUnit(new DefaultLocalizationRepository(), configRepository, new InlineStringsRepository());

            new LocalizationConfigPresenter(
                configRepository, defaultExportUnit)
            .Run();
        }
Пример #2
0
        public static void ShowTranslationsWindow()
        {
            var config = new EditorConfigRepository().GetInternalConfig();
            var defaultLocalizationRepository = new DefaultLocalizationRepository();
            var editorTranslationIORepository = new EditorTranslationIORepository(new TranslationStorageProvider());

            var ioUnit = new TranslationIOUnit(config, defaultLocalizationRepository, editorTranslationIORepository);

            new TranslationInfoPresenter(
                new EditorTranslationInfoRepository(), ioUnit)
            .Run();
        }
Пример #3
0
        public LocalizationConfigPresenter(EditorConfigRepository repository, DefaultLocalizationExportUnit defaultLocalizationExportUnit)
        {
            if (repository == null)
            {
                throw new ArgumentNullException(nameof(EditorConfigRepository));
            }

            if (defaultLocalizationExportUnit == null)
            {
                throw new ArgumentNullException(nameof(DefaultLocalizationExportUnit));
            }

            this._configRepository       = repository;
            this._localizationExportUnit = defaultLocalizationExportUnit;

            this._exportProviders = ReflectionHelper.GetAllSubtypesNames(typeof(ITranslationExport));
            this._importProviders = ReflectionHelper.GetAllSubtypesNames(typeof(ITranslationImport));
        }
Пример #4
0
        public DefaultLocalizationExportUnit(DefaultLocalizationRepository defaultLocalizationRepository, EditorConfigRepository editorConfigRepository, InlineStringsRepository inlineStringsRepository)
        {
            if (defaultLocalizationRepository == null)
            {
                throw new NullReferenceException(nameof(DefaultLocalizationRepository));
            }

            if (editorConfigRepository == null)
            {
                throw new NullReferenceException(nameof(EditorConfigRepository));
            }

            if (inlineStringsRepository == null)
            {
                throw new NullReferenceException(nameof(InlineStringsRepository));
            }

            this._defaultLocalizationRepository = defaultLocalizationRepository;

            this._scenesLocalizationProvider        = new ScenesLocalizationProvider(editorConfigRepository.GetInternalConfig());
            this._assetsLocalizationProvider        = new AssetsLocalizationProvider();
            this._inlineStringsLocalizationProvider = new InlineStringsLocalizationProvider(inlineStringsRepository);
        }