public FinishViewModel(TranslationMemoriesViewModel translationMemoriesViewModel, PackageDetailsViewModel packageDetailsViewModel)
 {
     _translationMemoriesViewModel = translationMemoriesViewModel;
     _packageDetailsViewModel      = packageDetailsViewModel;
     _package = _translationMemoriesViewModel.GetPackageModel();
     Refresh();
 }
        public StarTransitMainWindowViewModel(
            PackageDetailsViewModel packageDetailsViewModel,
            PackageDetails packageDetails,
            TranslationMemories translationMemories,
            TranslationMemoriesViewModel translationMemoriesViewModel,
            FinishViewModel finishViewModel,
            IMessageBoxService messageBoxService)
        {
            _messageBoxService            = messageBoxService;
            _packageDetailsViewModel      = packageDetailsViewModel;
            _packageDetails               = packageDetails;
            _translationMemories          = translationMemories;
            _translationMemoriesViewModel = translationMemoriesViewModel;
            CanExecuteBack     = false;
            CanExecuteCreate   = false;
            CanExecuteNext     = true;
            _isDetailsSelected = true;
            _isTmSelected      = false;
            _isFinishSelected  = false;
            _finishViewModel   = finishViewModel;
            Color = "#FFB69476";
            var helpers = new Shared.Utils.Helpers();

            _projectService = new ProjectService(DefaultFileTypeManager.CreateInstance(true), helpers);
        }
        public TranslationMemoriesViewModel(PackageDetailsViewModel packageDetailsViewModel)
        {
            _package = packageDetailsViewModel.GetPackageModel();
            var pairs = _package.LanguagePairs;

            foreach (var pair in pairs)
            {
                pair.PairNameIso = $"{pair.SourceLanguage.TwoLetterISOLanguageName}-{pair.TargetLanguage.TwoLetterISOLanguageName}";
                pair.PairName    = FormatPairName(pair.SourceLanguage.DisplayName, pair.TargetLanguage.DisplayName);
                pair.HasTm       = false;
                IsNoneChecked    = true;
            }

            _selectedIndex           = 0;
            LanguagePairs            = pairs;
            _buttonName              = "Browse";
            _visibility              = "Hidden";
            _isTmErrorMessageVisible = "Hidden";
            _isNoneChecked           = true;
            _title           = $"Please select Translation memory for pair {pairs[0].PairName}";
            _importMTVisible = "Hidden";

            var studioVersion = new Studio().GetStudioVersion();

            _initialFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                                              studioVersion.PublicVersion.Replace("SDL", "").Trim(),
                                              "Translation Memories");
        }
Esempio n. 4
0
        public async void Finish()
        {
            Active = true;
            var package = PackageDetailsViewModel.GetPackageModel();


            await Task.Run(() => _projectService.CreateProject(package));


            Active = false;
        }
 public StarTransitMainWindowViewModel(PackageDetailsViewModel packageDetailsViewModel, PackageDetails packageDetails, TranslationMemories translationMemories,
                                       FinishViewModel finishViewModel)
 {
     _packageDetailsViewModel = packageDetailsViewModel;
     _packageDetails          = packageDetails;
     CanExecuteBack           = false;
     CanExecuteCreate         = false;
     CanExecuteNext           = true;
     _isDetailsSelected       = true;
     _isTmSelected            = false;
     _isFinishSelected        = false;
     _finishViewModel         = finishViewModel;
     _projectService          = new ProjectService();
 }
Esempio n. 6
0
 public StarTransitMainWindowViewModel(PackageDetailsViewModel packageDetailsViewModel, PackageDetails packageDetails, TranslationMemories translationMemories, TranslationMemoriesViewModel translationMeloriesMemoriesViewModel,
                                       FinishViewModel finishViewModel, MetroWindow window)
 {
     _packageDetailsViewModel      = packageDetailsViewModel;
     _packageDetails               = packageDetails;
     _translationMemories          = translationMemories;
     _translationMemoriesViewModel = translationMeloriesMemoriesViewModel;
     CanExecuteBack     = false;
     CanExecuteCreate   = false;
     CanExecuteNext     = true;
     _isDetailsSelected = true;
     _isTmSelected      = false;
     _isFinishSelected  = false;
     _finishViewModel   = finishViewModel;
     _projectService    = new ProjectService();
     Color   = "#FFB69476";
     _window = window;
 }
        public TranslationMemoriesViewModel(PackageDetailsViewModel packageDetailsViewModel)
        {
            _package = packageDetailsViewModel.GetPackageModel();
            if (!(_package is null))
            {
                _package.MTMemories = new List <string>();
            }
            SetPackageLanguagePairs();

            _selectedIndex           = 0;
            _visibility              = "Collapsed";
            _isTmErrorMessageVisible = "Collapsed";
            _isNoneChecked           = true;
            _title           = $"Please select Translation memory for pair {LanguagePairs?[0]?.PairName}";
            _importMtVisible = "Collapsed";

            var studioVersion = new StudioVersionService().GetStudioVersion();

            _initialFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                                              studioVersion.StudioDocumentsFolderName, "Translation Memories");
        }
        public TranslationMemoriesViewModel(PackageDetailsViewModel packageDetailsViewModel)
        {
            _package = packageDetailsViewModel.GetPackageModel();
            var pairs = _package.LanguagePairs;

            foreach (var pair in pairs)
            {
                pair.PairNameIso = pair.SourceLanguage.TwoLetterISOLanguageName + "-" +
                                   pair.TargetLanguage.TwoLetterISOLanguageName;
                pair.PairName = FormatPairName(pair.SourceLanguage.DisplayName, pair.TargetLanguage.DisplayName);
                pair.HasTm    = false;
                IsNoneChecked = true;
            }

            _selectedIndex = 0;
            LanguagePairs  = pairs;
            _buttonName    = "Browse";
            _visibility    = "Hidden";
            _isNoneChecked = true;
            _title         = "Please select Translation memory  for pair " + pairs[0].PairName;
        }
Esempio n. 9
0
        public FinishViewModel(PackageDetailsViewModel packageDetailsViewModel)
        {
            _packageDetailsViewModel = packageDetailsViewModel;

            Refresh();
        }