Пример #1
0
 protected BaseMessageHandler(IActionHelper actionHelper, ITenantInfoRetriever tenantInfoRetriever, IConfigHelper configHelper, ITransactionValidator transactionValidator)
 {
     ActionHelper         = actionHelper;
     TenantInfoRetriever  = tenantInfoRetriever;
     ConfigHelper         = configHelper;
     TransactionValidator = transactionValidator;
 }
Пример #2
0
        public void ExecuteRequest(IMiddlerContext middlerContext, IActionHelper actionHelper)
        {
            var rewriteTo  = actionHelper.BuildPathFromRoutData(Parameters.RewriteTo);
            var isAbsolute = Uri.IsWellFormedUriString(rewriteTo, UriKind.Absolute);

            if (isAbsolute)
            {
                middlerContext.Request.Uri = new Uri(rewriteTo);
            }
            else
            {
                var builder = new UriBuilder(middlerContext.Request.Uri);
                builder.Query = null;
                if (rewriteTo.Contains("?"))
                {
                    builder.Path  = rewriteTo.Split("?")[0];
                    builder.Query = rewriteTo.Split("?")[1];
                }
                else
                {
                    builder.Path = rewriteTo;
                }


                middlerContext.Request.Uri = builder.Uri;
            }



            //middlerContext.ForwardBody();

            //var nUrl = new UriBuilder(Parameters.RewriteTo);
            //builder.Path = Parameters.RewriteTo;
        }
Пример #3
0
 public EmailService(ISessionHelper sessionHelper, IDistributedCacheWrapper distributedCache, IEnumerable <IEmailProvider> emailProviders, IActionHelper actionHelper)
 {
     _sessionHelper    = sessionHelper;
     _distributedCache = distributedCache;
     _emailProvider    = emailProviders.First();
     _actionHelper     = actionHelper;
 }
Пример #4
0
 public InstallServiceViewModel(IDialogHelper dialogHelper, IActionHelper actionHelper)
 {
     _actionHelper   = actionHelper;
     _dialogHelper   = dialogHelper;
     _cancelCommand  = new DelegateCommand(CancelExecuted);
     _installCommand = new DelegateCommand(InstallExecuted, InstallCanExecute);
 }
 public DynamicLookupPageTransformFactory(IActionHelper actionHelper,
                                          IEnumerable <ILookupProvider> lookupProviders,
                                          IWebHostEnvironment environment)
 {
     _actionHelper    = actionHelper;
     _lookupProviders = lookupProviders;
     _environment     = environment;
 }
Пример #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ActionSubjectTemplate"/> class.
        /// </summary>
        /// <param name="template">
        /// The template.
        /// </param>
        /// <param name="actionHelper">
        /// The action helper.
        /// </param>
        public ActionSubjectTemplate(LocalizableString template, IActionHelper actionHelper)
        {
            if (actionHelper == null)
                throw new ArgumentNullException("actionHelper");

            _actionHelper = actionHelper;

            _template = template;
        }
Пример #7
0
        public override async Task Process(IActionHelper actionHelper, IEmailProvider emailProvider, FormAnswers formAnswers)
        {
            var message = new EmailMessage(
                this.Properties.Subject,
                this.Properties.Content,
                this.Properties.From,
                actionHelper.GetEmailToAddresses(this, formAnswers));

            await emailProvider.SendEmail(message);
        }
Пример #8
0
        public ContactViewModel(IActionHelper actionHelper, IContactLogic contactLogic, ISettingLogic settingLogic, IMvxNavigationService navigationService)
        {
            _contactLogic      = contactLogic;
            _navigationService = navigationService;
            _settingLogic      = settingLogic;
            _actionHelper      = actionHelper;

            SaveContactCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(SaveContact));
            NumberPrefixes     = NumberPrefixProvider.GetNumberPrefixes();
        }
 public TemplatedEmailService(
     IEnumerable <ITemplatedEmailProvider> templatedEmailProviders,
     IActionHelper actionHelper,
     ISessionHelper sessionHelper,
     IDistributedCacheWrapper distributedCache)
 {
     _templatedEmailProviders = templatedEmailProviders;
     _actionHelper            = actionHelper;
     _sessionHelper           = sessionHelper;
     _distributedCache        = distributedCache;
 }
Пример #10
0
        public override Task ProcessTemplatedEmail(IActionHelper actionHelper, ITemplatedEmailProvider templatedEmailProvider, Dictionary <string, dynamic> personalisation, FormAnswers formAnswers)
        {
            var emailAddressList = actionHelper.GetEmailToAddresses(this, formAnswers).Split(',').ToList();

            foreach (var emailAddress in emailAddressList)
            {
                templatedEmailProvider
                .SendEmailAsync(emailAddress, Properties.TemplateId, personalisation);
            }

            return(null);
        }
Пример #11
0
        public BarrierViewModel(IBarrierLogic barrierLogic, ISettingLogic settingLogic, IActionHelper actionHelper, IMvxNavigationService navigationService, IMvxMessenger messenger)
        {
            _barrierLogic      = barrierLogic;
            _settingLogic      = settingLogic;
            _actionHelper      = actionHelper;
            _navigationService = navigationService;
            _messenger         = messenger;

            SaveBarrierCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(SaveBarrier));
            LoadBarrierCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(LoadBarrier));
            NumberPrefixes     = NumberPrefixProvider.GetNumberPrefixes();
        }
Пример #12
0
        public SettingsViewModel(ISettingLogic settingLogic, IActionHelper actionHelper, IMvxNavigationService navigationService,
                                 IMvxMessenger messenger)
        {
            _settingLogic      = settingLogic;
            _actionHelper      = actionHelper;
            _navigationService = navigationService;
            _messenger         = messenger;

            LoadSettingsCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(LoadSettings));
            SaveSettingsCommand = new MvxAsyncCommand(() => _actionHelper.DoAction(SaveSettings));
            NumberPrefixes      = NumberPrefixProvider.GetNumberPrefixes();
        }
Пример #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ActionMessageTemplate"/> class.
        /// </summary>
        /// <param name="template">
        /// The template.
        /// </param>
        /// <param name="actionHelper">
        /// The action helper.
        /// </param>
        /// <param name="deepLinkHelper">
        /// The deep link helper.
        /// </param>
        public ActionMessageTemplate(LocalizableString template, IActionHelper actionHelper, IDeepLinkHelper deepLinkHelper)
        {
            if (actionHelper == null)
                throw new ArgumentNullException("actionHelper");

            if (deepLinkHelper == null)
                throw new ArgumentNullException("deepLinkHelper");

            _actionHelper = actionHelper;
            _deepLinkHelper = deepLinkHelper;

            _template = template;
        }
Пример #14
0
 internal MainWindowViewModel(
     IActionHelper actionHelper,
     ITimeService timeService,
     INotificationReporter reporter,
     IProjectRunnerFactory runnerFactory)
 {
     _actionHelper            = actionHelper;
     _reporter                = reporter ?? new NotificationReporter(timeService);
     _reporter.ExpirationTime = TimeSpan.FromSeconds(1);
     _runnerFactory           = runnerFactory ??
                                new ProjectRunnerFactory(timeService, _reporter, new PHmiModelContextFactory(), new NpgHelper());
     _closeCommand = new DelegateCommand(CloseCommandExecuted, CloseCommandCanExecute);
 }
 public RetrieveExternalDataService(
     IGateway gateway,
     ISessionHelper sessionHelper,
     IDistributedCacheWrapper distributedCache,
     IMappingService mappingService,
     IActionHelper actionHelper,
     IWebHostEnvironment environment)
 {
     _gateway          = gateway;
     _sessionHelper    = sessionHelper;
     _distributedCache = distributedCache;
     _mappingService   = mappingService;
     _actionHelper     = actionHelper;
     _environment      = environment;
 }
Пример #16
0
        public void ExecuteRequest(IMiddlerContext middlerContext, IActionHelper actionHelper)
        {
            var uri = new Uri(actionHelper.BuildPathFromRoutData(Parameters.RedirectTo));

            if (Parameters.PreserveMethod)
            {
                middlerContext.Response.StatusCode = Parameters.Permanent ? StatusCodes.Status308PermanentRedirect : StatusCodes.Status307TemporaryRedirect;
            }
            else
            {
                middlerContext.Response.StatusCode = Parameters.Permanent ? StatusCodes.Status301MovedPermanently : StatusCodes.Status302Found;
            }

            middlerContext.Response.Headers["Location"] = uri.AbsoluteUri;
        }
Пример #17
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     ActionHelper         = new ActionHelperStub();
     TimeService          = new Mock <ITimeService>();
     NotificationReporter = new Mock <INotificationReporter>();
     RunnerFactory        = new Mock <IProjectRunnerFactory>();
     Runner = new Mock <IProjectRunner>();
     RunnerFactory.Setup(f => f.Create(Database, ConnectionString)).Returns(Runner.Object);
     Window    = new Mock <IWindow>();
     ViewModel = new MainWindowViewModel(
         ActionHelper, TimeService.Object, NotificationReporter.Object, RunnerFactory.Object)
     {
         View = Window.Object
     };
 }
Пример #18
0
 protected override void EstablishContext()
 {
     base.EstablishContext();
     ActionHelper = new ActionHelperStub();
     TimeService = new Mock<ITimeService>();
     NotificationReporter = new Mock<INotificationReporter>();
     RunnerFactory = new Mock<IProjectRunnerFactory>();
     Runner = new Mock<IProjectRunner>();
     RunnerFactory.Setup(f => f.Create(Database, ConnectionString)).Returns(Runner.Object);
     Window = new Mock<IWindow>();
     ViewModel = new MainWindowViewModel(
         ActionHelper, TimeService.Object, NotificationReporter.Object, RunnerFactory.Object)
         {
             View = Window.Object
         };
 }
Пример #19
0
 public BuildClientViewModel(
     IModelContextFactory contextFactory,
     IDialogHelper dialogHelper,
     IActionHelper actionHelper,
     ICodeWriterFactory codeWriterFactory,
     IResourceBuilderFactory resourceBuilderFactory)
 {
     _contextFactory         = contextFactory;
     _dialogHelper           = dialogHelper;
     _actionHelper           = actionHelper;
     _codeWriterFactory      = codeWriterFactory;
     _resourceBuilderFactory = resourceBuilderFactory;
     _buildCommand           = new DelegateCommand(BuildExecuted, BuildCanExecute);
     _cancelCommand          = new DelegateCommand(CancelExecuted);
     _chooseFolderCommand    = new DelegateCommand(ChooseFolderExecuted, ChooseFolderCanExecute);
     LoadFolder();
 }
 public GenerateTestsMessageHandler(IActionHelper actionHelper, ITenantInfoRetriever tenantInfoRetriever, IConfigHelper configHelper, ITransactionValidator transactionValidator) : base(actionHelper, tenantInfoRetriever, configHelper, transactionValidator)
 {
 }
 public ArtifactsPublishedMessageHandler(IActionHelper actionHelper, ITenantInfoRetriever tenantInfoRetriever, IConfigHelper configHelper, ITransactionValidator transactionValidator) : base(actionHelper, tenantInfoRetriever, configHelper, transactionValidator)
 {
 }
Пример #22
0
 public virtual async Task Process(IActionHelper actionHelper, IEmailProvider emailProvider, FormAnswers formAnswers)
 {
     throw new System.NotImplementedException();
 }
Пример #23
0
 public virtual Task ProcessTemplatedEmail(IActionHelper actionHelper, ITemplatedEmailProvider templatedEmailProvider, Dictionary <string, dynamic> personalisation, FormAnswers formAnswers)
 {
     throw new System.NotImplementedException();
 }
        public ActionMessageTemplateFactory(IActionHelper actionHelper, IDeepLinkHelper deepLinkHelper)
        {
            if (actionHelper == null)
                throw new ArgumentNullException("actionHelper");

            if (deepLinkHelper == null)
                throw new ArgumentNullException("deepLinkHelper");

            _actionHelper = actionHelper;
            _deepLinkHelper = deepLinkHelper;
        }
Пример #25
0
 public ReportCleanUpProcessor(ILogger logger, IActionHelper actionHelper)
 {
     _logger       = logger;
     _actionHelper = actionHelper;
 }
 public WorkflowsChangedMessageHandler(IActionHelper actionHelper, ITenantInfoRetriever tenantInfoRetriever, IConfigHelper configHelper, ITransactionValidator transactionValidator) : base(actionHelper, tenantInfoRetriever, configHelper, transactionValidator)
 {
 }
 public NotificationMessageHandler(IActionHelper actionHelper, ITenantInfoRetriever tenantInfoRetriever, IConfigHelper configHelper, ITransactionValidator transactionValidator) : base(actionHelper, tenantInfoRetriever, configHelper, transactionValidator)
 {
 }
Пример #28
0
 public WebhooksHandler(IActionHelper actionHelper, ITenantInfoRetriever tenantInfoRetriever, IConfigHelper configHelper, ITransactionValidator transactionValidator) : base(actionHelper, tenantInfoRetriever, configHelper, transactionValidator)
 {
 }