예제 #1
0
        public LanguageMappingsViewModel(SdlMTCloudTranslationOptions options, OptionsWindowModel beGlobalWindowViewModel,
                                         LanguagePair[] languagePairs, Languages.Provider.Languages languages)
        {
            _mtCloudDictionaries = new List <MTCloudDictionary>();
            _languages           = languages;
            _languagePairs       = languagePairs;

            Options                  = options;
            _languageMappings        = new ObservableCollection <LanguageMappingModel>();
            _beGlobalWindowViewModel = beGlobalWindowViewModel;

            _languageMappingService = new LanguageMappingsService();

            if (Options != null)
            {
                ReSendChecked = options.ResendDrafts;
            }

            BindingOperations.EnableCollectionSynchronization(LanguageMappings, _languageMappings);
        }
예제 #2
0
        public LoginViewModel(
            SdlMTCloudTranslationOptions options,
            LanguagePair[] languagePairs,
            LanguageMappingsViewModel languageMappingsViewModel,
            OptionsWindowModel beGlobalWindowViewModel)
        {
            _languagePairs = languagePairs;

            LanguageMappingsViewModel = languageMappingsViewModel;
            BeGlobalWindowViewModel   = beGlobalWindowViewModel;
            Options = options;

            AuthenticationOptions = new List <Authentication>
            {
                new Authentication
                {
                    DisplayName = Constants.ClientAuthentication,
                    Type        = Constants.Client
                },
                new Authentication
                {
                    DisplayName = Constants.UserAuthentication,
                    Type        = Constants.User
                }
            };

            if (!string.IsNullOrEmpty(options.AuthenticationMethod))
            {
                SelectedOption = options.AuthenticationMethod.Equals("ClientLogin")
                                        ? AuthenticationOptions[0]
                                        : AuthenticationOptions[1];
            }
            else
            {
                SelectedOption = AuthenticationOptions[1];
            }

            LoginMethod = SelectedOption.Type;
        }