public LicenseActivationTypeBase CreateLicense(int?licenseType, int licenseTermDays) { LicenseActivationTypeBase res = null; switch (licenseType) { case 3: res = new PromoLicenseActivationType(); break; case 5: res = new DontShowLicenseType(); break; default: res = new DownloadLicenseActivationType(); break; } res.LicenseDurationDays = licenseTermDays; res.InstallType = licenseType ?? 0; return(res); }
public EnterLicenseKeyViewModel(IResolver resolver, LicenseActivationTypeBase licenseMessages, LicenseActivationBusinessLayer licenseActivationBusinessLayer) : base(resolver) { if (resolver == null) { throw new ArgumentException("resolver"); } this.InstallType = licenseMessages.InstallType; this.resolver = resolver; this.webAPI = resolver.GetInstanceOf <IPBWebAPI>(); this.data = resolver.GetInstanceOf <IPBData>(); this.owner = ((PBApp)Application.Current).FindWindow <LoginWindow>(); this.LicenseMessages = licenseMessages; this.ActivateCommand = CreateActivateCommand(); this.BuyNowCommand = new RelayCommand(BuyNowCommandExecute); this.ContinueCommand = new RelayCommand(ContinueCommandExecute); this.ActivationSuccessDialogOk = new RelayCommand(ActivationSuccessDialogOkExecute); this.fadeTimerHelper = new ViewFadeTimerHelper(() => IsModalViewShown = true, () => IsModalViewShown = false, 3000); this.licenseActivationBusinessLayer = licenseActivationBusinessLayer; this.owner.Topmost = false; }