public InPlaceCompilingStoryRunner(IRemoteHandlerFactory factory, IScenarioPreprocessor preprocessor, IStoryFilter filter, ISessionContext context, IEventBus eventBus)
 {
     _factory = factory;
     _preprocessor = preprocessor;
     _filter = filter;
     _eventBus = eventBus;
 }
        void ServerParserBodyAvailable(byte[] data, ISessionContext context)
        {
            byte[] filter = Filter.EvaluateResponseFiltersWithBody(context.RecentResponseHeader,
                                                                   context.ClientConnection.ConnectionId,
                                                                   data);

            // Wait until now to send the header in case the filter modifies it, such as updating content-length.
            context.SendClientData(context.RecentResponseHeader.GetBuffer());

            // The body changed. Send the modified body and not the original body. Disconnect afterwards.
            if (filter != data)
            {
                ServiceLog.Logger.Info("{0} *** PERFORMANCE HIT *** Response filter activated. Body modified.", context.Id);

                if (filter.Length > 0)
                {
                    context.SendClientData(filter);
                    context.ChangeState(SessionStateType.Unconnected);
                }
            }
            else
            {
                // Change back to the normal connnection state
                context.ChangeState(SessionStateType.Connected);
                context.SendClientData(data);
            }
        }
Ejemplo n.º 3
0
 public void LoadData(ISessionContext sessionContext)
 {
     this.sessionContext = sessionContext;
     var today = DateTime.Today;
     monthCalendar.SelectionRange = new SelectionRange(today, today);
     RefreshData();
 }
Ejemplo n.º 4
0
 public StubGenerator(ScenarioInterpreter scenarioInterpreter, ImplementationHelper implementationHelper, ITextWriter suggestionWriter, ISessionContext context)
 {
     _scenarioInterpreter = scenarioInterpreter;
     SuggestionWriter = suggestionWriter;
     _context = context;
     _implementationHelper = implementationHelper;
 }
Ejemplo n.º 5
0
 public StoryContext(ISessionContext parent, IEnumerable<Type> types, Dictionary<Type, object> cache)
 {
     _parent = parent;
     _cache = cache;
     _cache = new Dictionary<Type, object>(cache);
     ImplementingTypes = types;
 }
Ejemplo n.º 6
0
        public override void TransitionToState( ISessionContext context )
        {
            Contract.Requires( context.ClientConnection != null );
            Contract.Requires( context.ServerConnection == null );

            context.SendClientData(Encoding.UTF8.GetBytes("HTTPS not supported"));
            context.Reset();

            //// TODO: is this required?
            //context.ClientConnection.CancelPendingReceive();
            //context.UnwireClientParserEvents();

            //ServiceLog.Logger.Info( "{0} Establishing HTTPS tunnel", context.Id );

            //string[] pathTokens = context.RecentRequestHeader.Path.Split( ':' );

            //if ( pathTokens.Length == 2 )
            //{
            //    context.ConnectToRemoteHost( pathTokens[0], Int32.Parse( pathTokens[1] ) );
            //}
            //else
            //{
            //    throw new InvalidDataException( "Unable to determine SSL host address" );
            //}

            //_context = context;
        }
 public GeofenceService(ILocationListener listener, IDistanceCalculatorService distanceCalculatorService, ISessionContext sessionContext)
 {
     this.Listener = listener;
     this.Listener.LocationChanged += this.OnLocationChanged;
     this.DistanceCalculatorService = distanceCalculatorService;
     this.SessionContext = sessionContext;
     this.timer = new Stopwatch();
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Save the given message to the underlying storage system.
        /// </summary>
        /// <param name="context">The session context.</param>
        /// <param name="message">The SMTP message to store.</param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>A unique identifier that represents this message in the underlying message store.</returns>
        public override Task<SmtpResponse> SaveAsync(ISessionContext context, IMimeMessage message, CancellationToken cancellationToken)
        {
            Console.WriteLine("From: {0} ({1})", message.From, context.RemoteEndPoint);
            Console.WriteLine("To: {0}", String.Join(",", message.To.Select(m => m.AsAddress())));
            Console.WriteLine(message.Mime);

            return Task.FromResult(SmtpResponse.Ok);
        }
Ejemplo n.º 9
0
 public static ActionResult HandleException(FrameworkException frameworkException, IExecutionContext executionCtx, ISessionContext sessionCtx)
 {
     IExceptionConfig expConfig = ExceptionBag.Get(frameworkException.ErrorId.ToString());
     IActionResultBuilder exceptionBuilder = ActionResultBuilderFactory.Create(expConfig.ResponseType, null);
     ExceptionCommand exceptionCommand = new ExceptionCommand(expConfig);
     ExceptionViewModel exceptionModel = exceptionCommand.Get(executionCtx, sessionCtx);
     return exceptionBuilder.Build(exceptionModel);
 }
Ejemplo n.º 10
0
 public InPlaceStoryRunner(ScenarioInterpreter scenarioInterpreter,
     IStoryFilter filter,
     ISessionContext context,
     IEventBus eventBus)
     : base(filter, context, eventBus)
 {
     _scenarioRunner = new InPlaceScenarioRunner(eventBus, scenarioInterpreter);
 }
 public FixtureGenerationStoryHandler(IFixtureGenerator fixtureGenerator,
                                      ITestFixtureWriter testFixtureWriter,
                                         ISessionContext context)
 {
     FixtureGenerator = fixtureGenerator;
     TestFixtureWriter = testFixtureWriter;
     _context = context;
 }
Ejemplo n.º 12
0
 public TcpConnection(TcpSocketClient socketClient, ISessionContext sessionContext, IRegistrator<string, IConnection> registrator)
 {
     this.socketClient = socketClient;
     this.sessionContext = sessionContext;
     this.registrator = registrator;
     this.socketClient.OnDataRecieved += OnDataRecieved;
     this.socketClient.OnExceptionThrown += OnSocketClientExceptionThrown;
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Called to initialize the add in.
        /// </summary>
        /// <remarks>
        /// If any exception is thrown during this call the add-in will not be loaded.
        /// </remarks>
        public void Initialize(ISessionContext context)
        {
            m_Context = context;
            m_Controller = (RepositoryController)m_Context.RepositoryController;

            //load up our baseline configuration
            ConfigurationChanged();
        }
Ejemplo n.º 14
0
        public override void RequestHeaderAvailable( IHttpRequest request, ISessionContext context )
        {
            ServiceLog.Logger.Verbose(
                () => string.Format(
                    "{0}\r\n=====existing conn======\r\n{1}\r\n========================\r\n",
                    context.Id, Encoding.UTF8.GetString(request.GetBuffer())));

            context.SendServerData(request.GetBuffer());
        }
Ejemplo n.º 15
0
 protected RuleBase(ISessionContext sessionContext)
 {
     this.sessionContext = sessionContext;
     actionPool = new Dictionary<string, Func<IEventMessage, string>>
                      {
                          {StateType.INIT, OnInitState},
                          {StateType.PLAYING, OnPlayingState},
                          {StateType.READY, OnReadyState},
                      };
 }
 public OrthogonalController(IMenuConfig menuConfig,
         ISessionContext sessionContext,
     IRepository repository,
     IContainer container)
 {
     _menuConfig = menuConfig;
     _sessionContext = sessionContext;
     _repository = repository;
     _container = container;
 }
        protected InPlaceStoryRunnerBase(IStoryFilter filter, ISessionContext context, IEventBus eventBus)
        {
            _filter = filter;
            _context = context;
            EventBus = eventBus;

            EventBus.Raise(new SessionStarting());

            Result = new JobResult();
        }
Ejemplo n.º 18
0
        public override void AcknowledgeClientShutdown(ISessionContext context)
        {
            ServiceLog.Logger.Verbose("{0} ACK client shutdown.", context.Id);

            // Shutdown the connection if there are no active transactions
            if (context.HttpPipelineDepth == 0)
            {
                context.Reset();
            }
        }
Ejemplo n.º 19
0
        public override void TransitionToState(ISessionContext context)
        {
            //context.UnwireClientParserEvents();

            if (context.ClientConnection != null)
            {
                context.SendClientData(Encoding.UTF8.GetBytes("HTTP/1.1 200 OK\r\nContent-length: 11\r\n\r\nProxy error"));
            }

            context.Reset();
        }
Ejemplo n.º 20
0
        public UnitOfWork(ISession session, ISessionContext sessionContext)
        {
            _session = session;
            _sessionContext = sessionContext;
            var enableOrgFilter = _session.EnableFilter("OrgConditionFilter");
            var enableDeleteFilter = _session.EnableFilter("DeletedConditionFilter");
            if (enableOrgFilter == null) return;

            enableOrgFilter.SetParameter("OrgId", _sessionContext.GetOrgId());
            enableDeleteFilter.SetParameter("Archived", false);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Returns a value indicating whether the given mailbox can be accepted as a sender.
        /// </summary>
        /// <param name="context">The session context.</param>
        /// <param name="from">The mailbox to test.</param>
        /// <param name="size">The estimated message size to accept.</param>
        /// <returns>The acceptance state of the mailbox.</returns>
        public async Task<MailboxFilterResult> CanAcceptFromAsync(ISessionContext context, IMailbox @from, int size = 0)
        {
            if (_filters == null || _filters.Any() == false)
            {
                return MailboxFilterResult.Yes;
            }

            var results = await Task.WhenAll(_filters.Select(f => f.CanAcceptFromAsync(context, @from, size)));

            return results.Max();
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Returns a value indicating whether the given mailbox can be accepted as a recipient to the given sender.
        /// </summary>
        /// <param name="context">The session context.</param>
        /// <param name="to">The mailbox to test.</param>
        /// <param name="from">The sender's mailbox.</param>
        /// <returns>The acceptance state of the mailbox.</returns>
        public async Task<MailboxFilterResult> CanDeliverToAsync(ISessionContext context, IMailbox to, IMailbox @from)
        {
            if (_filters == null || _filters.Any() == false)
            {
                return MailboxFilterResult.Yes;
            }

            var results = await Task.WhenAll(_filters.Select(f => f.CanDeliverToAsync(context, to, @from)));

            return results.Max();
        }
Ejemplo n.º 23
0
        public void Execute(ISessionContext ctx)
        {
            var dvr = ctx.SessionDriver;

            if (section > 0)
            {
                new SelectElement(dvr.Select("ctl00_ddl_Sections")).SelectByIndex(section);
            }
            dvr.Click("btnEdit");
            new RadFormFill("").Execute(ctx);
            dvr.Click("btnSave");
        }
        protected void Initialize()
        {
            if (this.Initialized)
            {
                return;
            }

            // create a new window instance based on the screen size
            this.window = new UIWindow(UIScreen.MainScreen.Bounds);
            this.SessionContext = this.ObjectFactory.Create<ISessionContext>();
            this.Initialized = true;
        }
Ejemplo n.º 25
0
 public TestCaseService(IRepository <Tellurium.VisualAssertions.Screenshots.Domain.TestCase> testCaseRepository,
                        IRepository <BrowserPattern> browserPatternRepository,
                        IRepository <Project> projectRepository,
                        ISessionContext sessionContext,
                        IRepository <TestCaseCategory> testCaseCategoryRepository)
 {
     this.testCaseRepository         = testCaseRepository;
     this.browserPatternRepository   = browserPatternRepository;
     this.projectRepository          = projectRepository;
     this.sessionContext             = sessionContext;
     this.testCaseCategoryRepository = testCaseCategoryRepository;
 }
Ejemplo n.º 26
0
 public InvestmentController(InvestmentRepository investmentRepository,
                             CashOrderRepository orderRepository,
                             CashOrderNumberCounterRepository counterRepository,
                             BranchContext branchContext,
                             ISessionContext sessionContext)
 {
     _investementRepository = investmentRepository;
     _orderRepository       = orderRepository;
     _counterRepository     = counterRepository;
     _branchContext         = branchContext;
     _sessionContext        = sessionContext;
 }
 public EventCustomerController(IEventCustomerAggregateRepository eventCustomerAggregateRepository, IEventCustomerRepository eventCustomerRepository, ICustomerRepository customerRepository,
                                IOrderRepository orderRepository, ISourceCodeRepository sourceCodeRepository, IOrderController orderController, IEventRepository eventRepository, ISessionContext sessionContext)
 {
     _eventCustomerAggregateRepository = eventCustomerAggregateRepository;
     _eventCustomerRepository          = eventCustomerRepository;
     _customerRepository   = customerRepository;
     _orderRepository      = orderRepository;
     _sourceCodeRepository = sourceCodeRepository;
     _orderController      = orderController;
     _eventRepository      = eventRepository;
     _sessionContext       = sessionContext;
 }
Ejemplo n.º 28
0
        public CorporateAccountController(IOrganizationService organizationRepository, ICorporateAccountRepository corporateAccountRepository, IShippingOptionRepository shippingOptionRepository,
                                          ILogManager logManager, ICorporateAccountService corporateAccountService, ITestRepository testRepository, ISessionContext sessionContext)
        {
            _organizationService        = organizationRepository;
            _corporateAccountRepository = corporateAccountRepository;
            _shippingOptionRepository   = shippingOptionRepository;
            _corporateAccountService    = corporateAccountService;
            _testRepository             = testRepository;

            _sessionContext = sessionContext;
            _logger         = logManager.GetLogger <CorporateAccountController>();
        }
Ejemplo n.º 29
0
        public void Execute(ISessionContext ctx)
        {
            var sd = ctx.SessionDriver;

            sd.Connect();
            ControlPopulate.RadDDL(ctx, "ddl_ReportList", $"{_report}");
            ControlPopulate.RadDDL(ctx, "ddl_Agency", "Justice");
            ControlPopulate.RadDDL(ctx, "ddl_Bureau", 1);
            ControlPopulate.RadDDL(ctx, "ddl_HVA", 1);
            ControlPopulate.RadDDL(ctx, "ddl_Assessment", 1);
            ControlPopulate.RadDDL(ctx, "ddl_POAM", 1);
        }
Ejemplo n.º 30
0
        private async Task CheckForLogoff(ISessionContext context)
        {
            if (context.Session.IsLoggingOff)
            {
                await context.Response.Append("Good bye!\r\n");
            }

            if (Next != null)
            {
                await Next.OnDataReceived(context);
            }
        }
Ejemplo n.º 31
0
        public override void ServerConnectionEstablished( ISessionContext context )
        {
            context.UnwireServerParserEvents();

            ServiceLog.Logger.Info("{0} HTTPS server connection established", context.Id);

            _tunnel = CoreFactory.Compose<ISslTunnel>();
            _tunnel.TunnelClosed += HandleTunnelClosed;
            _tunnel.EstablishTunnel( context.ClientConnection,
                                     context.ServerConnection,
                                     context.RecentRequestHeader.Version );
        }
Ejemplo n.º 32
0
        /// <summary>
        /// Returns a value indicating whether the given mailbox can be accepted as a sender.
        /// </summary>
        /// <param name="context">The session context.</param>
        /// <param name="from">The mailbox to test.</param>
        /// <param name="size">The estimated message size to accept.</param>
        /// <returns>The acceptance state of the mailbox.</returns>
        public override Task<MailboxFilterResult> CanAcceptFromAsync(ISessionContext context, IMailbox @from, int size = 0)
        {
            var endpoint = (IPEndPoint) context.RemoteEndPoint;
            
            // only accept connections from localhost
            if (endpoint.Address.Equals(IPAddress.Parse("127.0.0.1")))
            {
                return Task.FromResult(MailboxFilterResult.Yes);
            }

            return Task.FromResult(MailboxFilterResult.NoPermanently);
        }
Ejemplo n.º 33
0
        public void Execute(ISessionContext ctx)
        {
            var dvr = ctx.SessionDriver;

            dvr.Create();
            IList <IWebElement> elements = ctx.SessionDriver.Driver.FindElements(By.CssSelector("*[id*='_Surveys'] li"));

            foreach (IWebElement element in elements)
            {
                if (element.Text.ToUpper().Contains($"EINSTEIN"))
                {
                    element.Click();
                    break;
                }
            }
            dvr.Pause(550).Click("_hl_Launch");
            for (int i = _sectionFrom; i <= _sectionTo; i++)
            {
                dvr.Pause(_pause);
                SelectElement sections = new SelectElement(dvr.Select("ctl00_ddl_Sections"));
                sections.SelectByIndex(i);
                int recs = 0;
                while (recs < _records)
                {
                    dvr.Pause(_pause).Click("AddNewRecordButton_input");
                    ControlPopulate.GenericForm(ctx);
                    dvr.Pause(_pause).Click("_PerformInsertButton");
                    recs++;
                }

                try
                {
                    dvr.Pause(_pause).Click("_EditButton");
                    ControlPopulate.GenericForm(ctx);
                    dvr.Pause(_pause).Click("_UpdateButton");
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"EinsteinProcess: {ex.Message}");
                }
                try
                {
                    dvr.Driver.FindElement(By.CssSelector("a[title*='delete']")).Click();
                    IAlert alert = dvr.Pause(550).Driver.SwitchTo().Alert();
                    alert.Accept();
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"EinsteinProcess: {ex.Message}");
                }
            }
        }
Ejemplo n.º 34
0
 public SellingController(SellingRepository repository, CashOrderRepository cashOrderRepository, ContractRepository contractRepository,
                          CashOrderNumberCounterRepository counterRepository, SellingsExcelBuilder excelBuilder,
                          IStorage storage, BranchContext branchContext, ISessionContext sessionContext)
 {
     _repository          = repository;
     _cashOrderRepository = cashOrderRepository;
     _contractRepository  = contractRepository;
     _counterRepository   = counterRepository;
     _excelBuilder        = excelBuilder;
     _storage             = storage;
     _branchContext       = branchContext;
     _sessionContext      = sessionContext;
 }
Ejemplo n.º 35
0
 public ReportsController(ISettings settings, ITestResultService testResultService, IPhysicianEvaluationService physicianEvaluationService, IKynCustomerReportService kynCustomerReportService, ITestNotPerformedService testNotPerformedService,
                          IEventCustomerReportingService eventCustomerReportingService, ISessionContext sessionContext, IEventArchiveStatsService eventArchiveStatsService, IEventCustomerQuestionAnswerService eventCustomerQuestionAnswerServcie)
 {
     _pageSize                           = settings.DefaultPageSizeForReports;
     _testResultService                  = testResultService;
     _physicianEvaluationService         = physicianEvaluationService;
     _kynCustomerReportService           = kynCustomerReportService;
     _testNotPerformedService            = testNotPerformedService;
     _eventCustomerReportingService      = eventCustomerReportingService;
     _sessionContext                     = sessionContext;
     _eventArchiveStatsService           = eventArchiveStatsService;
     _eventCustomerQuestionAnswerServcie = eventCustomerQuestionAnswerServcie;
 }
Ejemplo n.º 36
0
        public Task <SmtpResponse> SaveAsync(ISessionContext context, IMimeMessage message, CancellationToken cancellationToken)
        {
            Console.WriteLine("MyMessageStore.SaveAsync");
            Console.WriteLine(message.Mime);

            var stream        = new MemoryStream(Encoding.UTF8.GetBytes(message.Mime.ToString()));
            var parser        = new MimeParser(stream);
            var parsedMessage = parser.ParseMessage();

            Store.AddMessage(parsedMessage);

            return(Task.FromResult(new SmtpResponse(SmtpReplyCode.Ok)));
        }
Ejemplo n.º 37
0
        private void AppendAssemblySetup(StringBuilder sb, ISessionContext sessionContext)
        {
            sb.AppendLine("    var assemblyRegistry = new " + typeof(AssemblyRegistry).FullName + "( new System.Reflection.Assembly[] {");
            var asses  = sessionContext.GetAllAssemblies().Select(x => "typeof(" + x.GetTypes().First().FullName + ").Assembly");
            var joined = string.Join(",\r\n        ", asses.ToArray());

            sb.AppendLine(joined);

            sb.AppendLine("    });");

            sb.AppendLine("   var eh = new StorEvil.Interpreter.ExtensionMethodHandler(assemblyRegistry);");
            sb.AppendLine("   // _sessionContext = new SessionContext();");
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LibraryViewModel"/> class with the specified <paramref name="sharedViewModel"/>.
 /// </summary>
 public LibraryViewModel(ISessionContext sessionContext)
 {
     _sessionContext = sessionContext;
     PlayCommand     = new RelayCommand <LibraryVideo>((video) => _sessionContext.CurrentlyPlaying = video);
     DeleteCommand   = new RelayCommand <LibraryVideo>((video) =>
     {
         _ = App.VideoLibrary.Remove(video);
         App.VideoLibrary.Save();
         File.Delete($@"{App.VideoFolderPath}/{video.Id}.mp4");
         File.Delete($@"{App.VideoFolderPath}/{video.Id}.webm");
         File.Delete($@"{App.ThumbnailFolderPath}/{video.Id}.jpg");
     });
 }
Ejemplo n.º 39
0
 public DailyViewPayloadWriter(ISessionContext sessionContext, TextWriter output, ExDateTime[] days, params CalendarAdapterBase[] adapters) : base(sessionContext, output)
 {
     if (adapters == null)
     {
         throw new ArgumentNullException("folderIds");
     }
     if (days == null)
     {
         throw new ArgumentNullException("days");
     }
     this.days     = days;
     this.adapters = adapters;
 }
Ejemplo n.º 40
0
        private void AppendAssemblySetup(StringBuilder sb, ISessionContext sessionContext)
        {
            sb.AppendLine("    var assemblyRegistry = new " + typeof(AssemblyRegistry).FullName +"( new System.Reflection.Assembly[] {");
            var asses = sessionContext.GetAllAssemblies().Select(x=> "typeof(" + x.GetTypes().First().FullName + ").Assembly");
            var joined = string.Join(",\r\n        ", asses.ToArray());

            sb.AppendLine(joined);

            sb.AppendLine("    });");

            sb.AppendLine("   var eh = new StorEvil.Interpreter.ExtensionMethodHandler(assemblyRegistry);");
            sb.AppendLine("   // _sessionContext = new SessionContext();");
        }
Ejemplo n.º 41
0
 public HealthPlanCallQueueController(IHealthPlanCallQueueService healthPlanCallQueueService, ISessionContext sessionContext, IHealthPlanEventService eventService,
                                      ICampaignService campaignService, ICampaignActivityRepository campaignActivityRepository, ICustomerCallQueueCallAttemptService customerCallQueueCallAttemptService,
                                      ICallQueueCustomerDetailService callQueueCustomerDetailService, ICallQueueCustomerContactService callQueueCustomerContactService)
 {
     _healthPlanCallQueueService = healthPlanCallQueueService;
     _sessionContext             = sessionContext;
     _eventService                        = eventService;
     _campaignService                     = campaignService;
     _campaignActivityRepository          = campaignActivityRepository;
     _customerCallQueueCallAttemptService = customerCallQueueCallAttemptService;
     _callQueueCustomerDetailService      = callQueueCustomerDetailService;
     _callQueueCustomerContactService     = callQueueCustomerContactService;
 }
Ejemplo n.º 42
0
 public LoginController(ISessionContext sessionContext, IUserLoginRepository userLoginRepository, IUserLoginService userLoginService, IUserRepository <User> userRepository, IUniqueItemRepository <UserLoginLog> uniqueItemRepository,
                        ILogManager logManager, ITechnicianRepository technicianRepository, IConfigurationSettingRepository configurationSettingRepository, IPinChangeLogService pinChangeLogService)
 {
     _sessionContext                 = sessionContext;
     _userLoginRepository            = userLoginRepository;
     _userLoginService               = userLoginService;
     _userRepository                 = userRepository;
     _uniqueItemRepository           = uniqueItemRepository;
     _technicianRepository           = technicianRepository;
     _configurationSettingRepository = configurationSettingRepository;
     _pinChangeLogService            = pinChangeLogService;
     _logger = logManager.GetLogger <LoginController>();
 }
Ejemplo n.º 43
0
        public void Execute(ISessionContext ctx)
        {
            var driver = ctx.SessionDriver.Driver;

            try
            {
                ctx.SessionDriver.Pause(this.time);
            }
            catch (Exception ex)
            {
                Console.Write($"Invalid Pause {ex.Message} ");
            }
        }
Ejemplo n.º 44
0
 public LoginOtpService(ILoginOtpRepository loginOtpRepository, IConfigurationSettingRepository configurationSettingRepository, IRandomStringGenerator randomStringGenerator,
                        INotifier notifier, IPhoneNotificationModelsFactory smsNotificationModelsFactory, IEmailNotificationModelsFactory emailNotificationModelsFactory, ILoginSettingRepository loginSettingRepository,
                        ISessionContext sessionContext)
 {
     _loginOtpRepository             = loginOtpRepository;
     _configurationSettingRepository = configurationSettingRepository;
     _randomStringGenerator          = randomStringGenerator;
     _notifier = notifier;
     _smsNotificationModelsFactory   = smsNotificationModelsFactory;
     _emailNotificationModelsFactory = emailNotificationModelsFactory;
     _loginSettingRepository         = loginSettingRepository;
     _sessionContext = sessionContext;
 }
Ejemplo n.º 45
0
        SaveAsync(ISessionContext context,
                  IMessageTransaction transaction,
                  CancellationToken cancellationToken)
        {
            ITextMessage textMessage = (ITextMessage)transaction.Message;

            using (var reader = new StreamReader(textMessage.Content, Encoding.UTF8))
            {
                Message.Invoke(reader.ReadToEnd());
            }

            return(Task.FromResult(SmtpResponse.Ok));
        }
Ejemplo n.º 46
0
 public DashboardController(ISessionContext sessionContext, IPhysicianEvaluationService physicianEvaluationService, IPhysicianEvaluationRepository physicianEvaluationRepository, IPhysicianRepository physicianRepository,
                            IOrganizationService organizationService, ILogManager logManager, IHospitalPartnerService hospitalPartnerService, IEventService eventService, ISettings settings)
 {
     _sessionContext                = sessionContext;
     _physicianRepository           = physicianRepository;
     _physicianEvaluationService    = physicianEvaluationService;
     _physicianEvaluationRepository = physicianEvaluationRepository;
     _organizationService           = organizationService;
     _hospitalPartnerService        = hospitalPartnerService;
     _eventService         = eventService;
     _logger               = logManager.GetLogger <Global>();
     _pageSizeForDashboard = settings.DashboardEventListingPageSize;
 }
Ejemplo n.º 47
0
 private void SetCulture(ISessionContext sessionContext)
 {
     if (sessionContext == null || sessionContext.UserProfile == null)
     {
         System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(ConfigurationManager.AppSettings["culture"]);
         System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(ConfigurationManager.AppSettings["culture"]);
     }
     else
     {
         System.Threading.Thread.CurrentThread.CurrentCulture = sessionContext.UserProfile.UserCultureInfo;
         System.Threading.Thread.CurrentThread.CurrentUICulture = sessionContext.UserProfile.UserCultureInfo;
     }
 }
Ejemplo n.º 48
0
 public PhoneNumberUploadController(IMediaRepository mediaRepository, IPhoneNumberUpdateUploadHelper phoneNumberUpdateUploadHelper, ISessionContext sessionContext,
                                    IUniqueItemRepository <File> fileRepository, ICustomerPhoneNumberUpdateUploadRepository customerPhoneNumberUpdateUploadRepository, ICsvReader csvReader, ISettings settings,
                                    IPhoneNumberUploadService phoneNumberUploadService)
 {
     _mediaRepository = mediaRepository;
     _phoneNumberUpdateUploadHelper = phoneNumberUpdateUploadHelper;
     _sessionContext = sessionContext;
     _fileRepository = fileRepository;
     _customerPhoneNumberUpdateUploadRepository = customerPhoneNumberUpdateUploadRepository;
     _csvReader = csvReader;
     _phoneNumberUploadService = phoneNumberUploadService;
     _pageSize = settings.DefaultPageSizeForReports;
 }
Ejemplo n.º 49
0
 private void SetCulture(ISessionContext sessionContext)
 {
     if (sessionContext == null || sessionContext.UserProfile == null)
     {
         System.Threading.Thread.CurrentThread.CurrentCulture   = new System.Globalization.CultureInfo(ConfigurationManager.AppSettings["culture"]);
         System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(ConfigurationManager.AppSettings["culture"]);
     }
     else
     {
         System.Threading.Thread.CurrentThread.CurrentCulture   = sessionContext.UserProfile.UserCultureInfo;
         System.Threading.Thread.CurrentThread.CurrentUICulture = sessionContext.UserProfile.UserCultureInfo;
     }
 }
Ejemplo n.º 50
0
        public override async Task <SmtpResponse> SaveAsync(
            ISessionContext context,
            IMessageTransaction transaction,
            CancellationToken cancellationToken)
        {
            var textMessage = (ITextMessage)transaction.Message;

            this._receivedDataHandler.HandleReceived(
                await ToArrayAsync(textMessage.Content),
                transaction.To.Select(s => s.AsAddress()).ToArray());

            return(SmtpResponse.Ok);
        }
Ejemplo n.º 51
0
        const int WaitForSeconds = 450; //seven and half
        //private ConnectionMultiplexer _redis;
        //private ConnectionMultiplexer ConnectionMultiplexer
        //{
        //    get
        //    {
        //        if (_redis == null || !_redis.IsConnected)
        //        {
        //            var config = ConfigurationOptions.Parse(_host);
        //            config.KeepAlive = WaitForSeconds;
        //            //config.ConnectTimeout = 5000;
        //            _redis = ConnectionMultiplexer.Connect(config);
        //        }
        //        return _redis;
        //    }
        //}

        public BaseReportsController(IZipHelper zipHelper, ILogManager logManager, ISessionContext sessionContext, ILoginSettingRepository loginSettingRepository,
                                     IRoleRepository roleRepository, IOrganizationRoleUserRepository organizationRoleUserRepository, IUserRepository <User> userRepository, ISettings settings)
        {
            _zipHelper                      = zipHelper;
            _logger                         = logManager.GetLogger <Global>();
            _sessionContext                 = sessionContext;
            _loginSettingRepository         = loginSettingRepository;
            _organizationRoleUserRepository = organizationRoleUserRepository;
            _roleRepository                 = roleRepository;
            _userRepository                 = userRepository;
            //_host = settings.RedisServerHost;
            _redisDatabaseKey = settings.RedisDatabaseKey;
        }
Ejemplo n.º 52
0
        // Token: 0x06002FDC RID: 12252 RVA: 0x0011756C File Offset: 0x0011576C
        private static ExDateTime[] GetViewDaysForMonthlyView(ISessionContext sessionContext, ExDateTime start)
        {
            ExDateTime exDateTime;
            ExDateTime exDateTime2;

            DatePickerBase.GetVisibleDateRange(start, out exDateTime, out exDateTime2, sessionContext.TimeZone);
            ExDateTime[] array = new ExDateTime[42 - exDateTime2.Day / 7 * 7];
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = exDateTime.IncrementDays(i);
            }
            return(array);
        }
Ejemplo n.º 53
0
 public SuspectConditionController(IMediaRepository mediaRepository, ISessionContext session, IUniqueItemRepository <File> fileRepository,
                                   ISuspectConditionUploadRepository suspectConditionUploadRepository, ISuspectConditionUploadHelper suspectConditionUploadHelper, ISuspectConditionService SuspectConditionService,
                                   ISettings settings, ISuspectConditionUploadLogRepository suspectConditionUploadLogRepository)
 {
     _mediaRepository = mediaRepository;
     _session         = session;
     _fileRepository  = fileRepository;
     _suspectConditionUploadRepository = suspectConditionUploadRepository;
     _suspectConditionUploadHelper     = suspectConditionUploadHelper;
     _SuspectConditionService          = SuspectConditionService;
     _pageSize = settings.DefaultPageSizeForReports;
     _suspectConditionUploadLogRepository = suspectConditionUploadLogRepository;
 }
Ejemplo n.º 54
0
        public static void RadDDL(ISessionContext ctx, string DDL, string Item)
        {
            ChromeDriver driver = ctx.SessionDriver.Driver;
            var          ddl    = driver.FindElement(By.CssSelector($"*[id$='{DDL}']"));

            ddl.Click();
            System.Threading.Thread.Sleep(100);
            ddl = driver.FindElement(By.CssSelector($"div[id*='{DDL}_DropDown'] .rddlPopup"));
            var report = ddl.FindElement(By.XPath($"//li[contains(string(), '{Item}')]"))
                         ?? ddl.FindElement(By.XPath($"//span[contains(string(), '{Item}')]"));

            report.Click();
        }
Ejemplo n.º 55
0
        public CustomerRegistrationService(IMassRegistrationEditModelFactory massRegistrationEditModelFactory, ISessionContext sessionContext,
                                           ICustomerService customerService, IOrganizationRoleUserRepository orgRoleUserRepository,
                                           IEventPackageRepository eventPackageRepository, IEventCustomerRepository eventCustomerRepository, IOrderController orderController,
                                           IAddressService addressService, IShippingOptionRepository shippingOptionRepository, IShippingController shippingController, INotifier notifier,
                                           IEmailNotificationModelsFactory emailNotificationModelsFactory, IEventTestRepository eventTestRepository, ISettings settings, IStateRepository stateRepository,
                                           IEventAppointmentService eventAppointmentService, IEventPackageSelectorService eventPackageSelectorService, IEventSchedulingSlotService eventSchedulingSlotService,
                                           IEventRepository eventRepository, IPhoneNotificationModelsFactory smsNotificationModelsFactory, ICorporateAccountRepository corporateAccountRepository,
                                           IEmailTemplateRepository emailTemplateRepository, ICustomerRepository customerRepository, ICustomerNotesService customerNotesService,
                                           ILanguageRepository languageRepository, ILabRepository labRepository, IUserLoginRepository userLoginRepository, ILogManager logManager,
                                           IEventCustomerNotificationRepository eventCustomerNotificationRepository, ICorporateCustomerUploadService corporateCustomerUploadService,
                                           ICurrentMedicationRepository currentMedicationRepository, ICustomerIcdCodesRepository customerIcdCodesRepository,
                                           IEventCustomerCurrentMedicationRepository eventCustomerCurrentMedicationRepository, IEventCustomerIcdCodesRepository eventCustomerIcdCodesRepository)
        {
            _massRegistrationEditModelFactory = massRegistrationEditModelFactory;
            _sessionContext           = sessionContext;
            _customerService          = customerService;
            _orgRoleUserRepository    = orgRoleUserRepository;
            _eventPackageRepository   = eventPackageRepository;
            _eventCustomerRepository  = eventCustomerRepository;
            _orderController          = orderController;
            _addressService           = addressService;
            _shippingOptionRepository = shippingOptionRepository;
            _shippingController       = shippingController;
            _notifier = notifier;
            _emailNotificationModelsFactory = emailNotificationModelsFactory;
            _eventTestRepository            = eventTestRepository;
            _settings                     = settings;
            _stateRepository              = stateRepository;
            _eventAppointmentService      = eventAppointmentService;
            _eventPackageSelectorService  = eventPackageSelectorService;
            _eventSchedulingSlotService   = eventSchedulingSlotService;
            _eventRepository              = eventRepository;
            _smsNotificationModelsFactory = smsNotificationModelsFactory;
            _corporateAccountRepository   = corporateAccountRepository;
            _emailTemplateRepository      = emailTemplateRepository;
            _customerRepository           = customerRepository;
            _customerNotesService         = customerNotesService;

            _languageRepository  = languageRepository;
            _labRepository       = labRepository;
            _userLoginRepository = userLoginRepository;

            _eventCustomerNotificationRepository = eventCustomerNotificationRepository;

            _corporateCustomerUploadService           = corporateCustomerUploadService;
            _currentMedicationRepository              = currentMedicationRepository;
            _customerIcdCodesRepository               = customerIcdCodesRepository;
            _eventCustomerCurrentMedicationRepository = eventCustomerCurrentMedicationRepository;
            _eventCustomerIcdCodesRepository          = eventCustomerIcdCodesRepository;
            _logger = logManager.GetLogger("Customer Registration Service");
        }
Ejemplo n.º 56
0
 public UserProfileController(IRepository repository,
                              ISessionContext sessionContext,
                              ISecurityDataService securityDataService,
                              ISaveEntityService saveEntityService,
     IUpdateCollectionService updateCollectionService,
     ISelectListItemService selectListItemService)
 {
     _repository = repository;
     _sessionContext = sessionContext;
     _securityDataService = securityDataService;
     _saveEntityService = saveEntityService;
     _updateCollectionService = updateCollectionService;
     _selectListItemService = selectListItemService;
 }
Ejemplo n.º 57
0
        // Token: 0x0600013E RID: 318 RVA: 0x0000A1B8 File Offset: 0x000083B8
        public static TimeStripMode GetPersistedTimeStripMode(ISessionContext sessionContext)
        {
            if (sessionContext == null)
            {
                throw new ArgumentNullException("sessionContext");
            }
            int hourIncrement = sessionContext.HourIncrement;

            if (hourIncrement != 15)
            {
                return(TimeStripMode.ThirtyMinutes);
            }
            return(TimeStripMode.FifteenMinutes);
        }
Ejemplo n.º 58
0
        /*
        #if PCL
        private Random secureRandom;
        #else
        private RNGCryptoServiceProvider secureRandom;
        #endif
        */
        internal QueryContext(ISessionContext parentContext)
            : base(parentContext)
        {
            this.RegisterInstance<IQueryContext>(this);
            /*
            #if PCL
            secureRandom = new Random();
            #else
            secureRandom = new RNGCryptoServiceProvider();
            #endif
            */

            this.RegisterInstance<ICache>(new MemoryCache(), "TableCache");
        }
Ejemplo n.º 59
0
 public PrintMonthlyView(ISessionContext sessionContext, CalendarAdapterBase calendarAdapter, bool workingDayOnly) : base(sessionContext, calendarAdapter)
 {
     this.showWeekNumbers = sessionContext.ShowWeekNumbers;
     this.calendar        = new GregorianCalendar();
     this.daysFormat      = (DateTimeUtilities.GetDaysFormat(sessionContext.DateFormat) ?? "%d");
     this.firstDayFormat  = "MMM %d";
     if (CalendarUtilities.FullMonthNameRequired(sessionContext.UserCulture))
     {
         this.firstDayFormat = string.Format("MMMM {0}", this.daysFormat);
     }
     this.workingDayOnly = workingDayOnly;
     this.sessionContext = sessionContext;
     this.workDays       = PrintMonthlyView.GetWorkingDays(calendarAdapter, sessionContext);
 }
Ejemplo n.º 60
0
        public RemoteScenarioExecutor(IRemoteTaskServer server, AssemblyRegistry assemblyRegistry)
        {
            _server = server;
            _assemblyRegistry = assemblyRegistry;
            _sessionContext = new SessionContext(assemblyRegistry);

            _eventBus = new EventBus();
            _listener = new ResharperResultListener(_server);

            _resolver = new MostRecentlyUsedContext();
            _runner = BuildInPlaceRunner(_resolver);

            _eventBus.Register(_resolver);
            _eventBus.Register(_listener);
        }