public static DictionaryWriter GetWriter()
        {
            if (_dictionaryWriter != null)
            {
                return(_dictionaryWriter);
            }

            var dictionaryTypeToPathMap = DictionaryTypeToPathMapInitializer.GetMap();

            _dictionaryWriter = new DictionaryWriter(dictionaryTypeToPathMap.GetDictionaryPath(Config.Instance.DictionaryType));
            return(_dictionaryWriter);
        }
Пример #2
0
        public static TranslationWayToReaderCommandHandler Get()
        {
            if (_translationWayToReaderCommandHandler != null)
            {
                return(_translationWayToReaderCommandHandler);
            }

            _translationWayToReaderCommandHandler = new TranslationWayToReaderCommandHandler();
            var dictionaryTypeToDictionaryPathMap = DictionaryTypeToPathMapInitializer.GetMap();
            var dictionaryType = Config.Instance.DictionaryType;

            _translationWayToReaderCommandHandler.Register(TranslationWay.SerbianToEnglish, new SerbianToEnglishDictionaryReader(dictionaryTypeToDictionaryPathMap.GetDictionaryPath(dictionaryType)));
            _translationWayToReaderCommandHandler.Register(TranslationWay.EnglishToSerbian, new EnglishToSerbianDictionaryReader(dictionaryTypeToDictionaryPathMap.GetDictionaryPath(dictionaryType)));


            return(_translationWayToReaderCommandHandler);
        }