public RedisServer(RedisConnection connection, string serviceQueue, IServiceFactory serviceFactory)
 {
     this.connection = connection;
     this.serviceFactory = serviceFactory;
     this.serviceQueue = serviceQueue;
     this.receiveState = 0;
 }
 public RequestProcessor(JsonSerializer serializer, IServiceFactory serviceFactory, IServiceCatalog services, IServiceInvoker serviceInvoker)
 {
     this.serializer = serializer;
     this.serviceFactory = serviceFactory;
     this.services = services;
     this.serviceInvoker = serviceInvoker;
 }
        public AudioController(IServiceFactory ninjectFactory)
        {
            if (ninjectFactory == null)
                throw new ArgumentNullException(nameof(ninjectFactory));

            _tracksService = ninjectFactory.CreateTracksService();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
 /// </summary>
 /// <param name="modalDialogProvider">The modal dialog service.</param>
 /// <param name="serviceFactory">The service factory.</param>
 public SaleGroupViewModel(IMainViewModel mainViewModel, IModalDialogProvider modalDialogProvider, IServiceFactory serviceFactory)
     : base(mainViewModel, modalDialogProvider, serviceFactory)
 {
     ClientsAndBuildingsTabItemViewModel = new ClientsAndBuildingsTabItemViewModel(mainViewModel, ModalDialogProvider, ServiceFactory);
       OrdersTabItemViewModel = new OrdersTabItemViewModel(mainViewModel, ModalDialogProvider, ServiceFactory);
       DeliveryNotesTabItemViewModel = new DeliveryNotesTabItemViewModel(mainViewModel, ModalDialogProvider, ServiceFactory);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ManageDeliveryNotesViewModel"/> class.
 /// </summary>
 /// <param name="modalDialogService">The modal dialog service.</param>
 /// <param name="serviceFactory">The service factory.</param>
 public ManageDeliveryNotesViewModel(IModalDialogService modalDialogService, IServiceFactory serviceFactory)
     : base(modalDialogService, serviceFactory)
 {
     SelectableDeliveryNote = new SelectableViewModelBase<DeliveryNotePackage>();
       ShowCanceledDeliveryNotes = true;
       LoadDeliveryNotes(string.Empty, ShowCanceledDeliveryNotes);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
 /// </summary>
 /// <param name="modalDialogProvider">The modal dialog service.</param>
 /// <param name="serviceFactory">The service factory.</param>
 public AdministrationGroupViewModel(IMainViewModel mainViewModel, IModalDialogProvider modalDialogProvider, IServiceFactory serviceFactory)
     : base(mainViewModel, modalDialogProvider, serviceFactory)
 {
     DriversAndCarsTabItemViewModel = new DriversAndCarsTabItemViewModel(mainViewModel, ModalDialogProvider, ServiceFactory);
       MaterialsAndContractorsTabItemViewModel = new MaterialsAndContractorsTabItemViewModel(mainViewModel, ModalDialogProvider, ServiceFactory);
       RecipesTabItemViewModel = new RecipesTabItemViewModel(mainViewModel, ModalDialogProvider, ServiceFactory);
 }
 public DashboardController(IServiceFactory factory, 
                            IProcess<OrgMemberDocVisibilityByOrgAdminParams, GeneralSuccessResultViewModel> orgDocVisibilityProcess)
 {
     _serviceFactory = factory;
     _unitOfWork = factory.GetService<IUnitOfWork>();
     _orgDocVisibilityProcess = orgDocVisibilityProcess;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceSynchronizationService"/> class.
 /// </summary>
 /// <param name="medicalProcedureTranslator">The medical procedure translator.</param>
 /// <param name="serviceRepository">The service repository.</param>
 /// <param name="serviceFactory">The service factory.</param>
 /// <param name="lookupValueRepository">The lookup value repository.</param>
 public ServiceSynchronizationService(IMedicalProcedureTranslator medicalProcedureTranslator, IServiceRepository serviceRepository, IServiceFactory serviceFactory, ILookupValueRepository lookupValueRepository)
 {
     _medicalProcedureTranslator = medicalProcedureTranslator;
     _serviceRepository = serviceRepository;
     _serviceFactory = serviceFactory;
     _lookupValueRepository = lookupValueRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MessagingServer" /> class.
 /// </summary>
 /// <param name="clientFactory">Used to create the class that you use to handle all client communication.</param>
 /// <param name="configuration">The configuration.</param>
 public MessagingServer(IServiceFactory clientFactory, MessagingServerConfiguration configuration)
     : base(clientFactory, configuration)
 {
     if (clientFactory == null) throw new ArgumentNullException("clientFactory");
     if (configuration == null) throw new ArgumentNullException("configuration");
     _formatterFactory = configuration.MessageFormatterFactory;
 }
        public ReservationsViewModel(IServiceFactory serviceFactory)
        {
            _ServiceFactory = serviceFactory;

            ExecuteRentalCommand = new DelegateCommand<int>(OnExecuteRentalCommandExecute);
            CancelReservationCommand = new DelegateCommand<int>(OnCancelReservationCommandExecute);
        }
 public UcLoadDailyMeasures(IServiceFactory serviceFactory, IStateController stateController)
 {
     _stateController = stateController;
     _serviceFactory = serviceFactory;
     InitializeComponent();
     gvDailyMeasures.TableElement.RowHeight = Avicola.Common.Win.GlobalConstants.DefaultRowHeight;
 }
 public MainVM(IServiceFactory serviceFactory)
 {
     _ServiceFactory = serviceFactory;
     MainVM._Instance = this;
     _MainModel = new Model.MainModel();
     Status = "Disconnected";
 }
 public FrmCreateEditClient(Guid id, IFormFactory formFactory, IServiceFactory serviceFactory)
 {
     FormFactory = formFactory;
     _serviceFactory = serviceFactory;
     _clientId = id;
     InitializeComponent();
 }
Exemple #14
0
        private void DefineProxyType(IServiceFactory servicefactory, ProxyDefinition proxyDefinition)
        {
            //container.Register<ILogFactory, LogFactory>();
            //container.Register<ILogBase,log.Logger>();

            proxyDefinition.Implement(() => servicefactory.GetInstance<IInterceptor>("LogInterceptor"));
        }
        // note that this viewmodel is instantiated on-demand from parent and not with DI

        public EditOrderViewModel(IServiceFactory serviceFactory, int orderId)
        {
            _serviceFactory = serviceFactory ?? Container.GetExportedValue<IServiceFactory>();

            if (orderId == 0)
            {
                _order = new Order();
            }
            else
            {
                WithClient(_serviceFactory.CreateClient<IOrderService>(), orderClient =>
                {
                    _order = orderClient.GetOrder(orderId);
                });
            }

            _order.CleanAll();
            LoadSuppliers();

            EditOrderDetailCommand = new DelegateCommand<OrderDetail>(OnEditOrderDetailCommand);
            AddOrderDetailCommand = new DelegateCommand<object>(OnAddOrderDetailCommand);
            DeleteOrderDetailCommand = new DelegateCommand<int>(OnDeleteOrderDetailCommand);

            SaveCommand = new DelegateCommand<object>(OnSaveCommandExecute, OnSaveCommandCanExecute);
            CancelCommand = new DelegateCommand<object>(OnCancelCommandExecute);
        }
Exemple #16
0
        /// <summary>
        /// Creates a new resource for the specified discovery version with the specified name and json dictionary.
        /// </summary>
        internal Resource(IServiceFactory factory, string name, JsonDictionary dictionary)
            : base(factory)
        {
            name.ThrowIfNull("name");
            dictionary.ThrowIfNull("dictionary");

            logger.Debug("Constructing Resource [{0}]", name);
            Name = name;
            information = dictionary;
            if (information == null)
            {
                throw new ArgumentException("got no valid dictionary");
            }

            // Initialize subresources.
            if (information.ContainsKey("resources"))
            {
                var resourceJson = (JsonDictionary)information["resources"];
                resources = new Dictionary<string, IResource>();
                foreach (KeyValuePair<string, object> pair in resourceJson)
                {
                    // Create the subresource.
                    var subResource = (Resource)Factory.CreateResource(pair.Key, pair.Value as JsonDictionary);
                    subResource.Parent = this;
                    resources.Add(pair.Key, subResource);
                }
            }
        }
Exemple #17
0
        /// <summary>
        /// Creates a new parameter with the specified name and value.
        /// </summary>
        public BaseParameter(IServiceFactory factory, string name, JsonDictionary dictionary)
            : base(factory)
        {
            Name = name;
            information = dictionary;
			information.ThrowIfNull("got no valid dictionary");
        }
        public FrmAddStock(IServiceFactory serviceFactory, IMessageBoxDisplayService messageBoxDisplayService)
        {
            _serviceFactory = serviceFactory;
            _messageBoxDisplayService = messageBoxDisplayService;

            InitializeComponent();
        }
 public FrmEndBatch(Guid id, IFormFactory formFactory, IServiceFactory serviceFactory)
 {
     FormFactory = formFactory;
     _serviceFactory = serviceFactory;
     _batchId = id;
     InitializeComponent();
 }
Exemple #20
0
 protected ServiceBase(Game game)
 {
     Game = game;
      NumberRandomizer = new NumberRandomizer();
      ListRandomizer = new ListRandomizer();
      ServiceFactory = new ServiceFactory();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ManageOrdersViewModel"/> class.
 /// </summary>
 /// <param name="modalDialogService">The modal dialog service.</param>
 /// <param name="serviceFactory">The service factory.</param>
 public ManageOrdersViewModel(IModalDialogService modalDialogService, IServiceFactory serviceFactory)
     : base(modalDialogService, serviceFactory)
 {
     SelectableOrder = new SelectableViewModelBase<OrderPackage>();
       ShowCanceledOrders = true;
       LoadOrders(string.Empty, ShowCanceledOrders);
 }
        public FrmDepositManager(IFormFactory formFactory, IMessageBoxDisplayService messageBoxDisplayService, IServiceFactory serviceFactory)
        {
            FormFactory = formFactory;
            MessageBoxDisplayService = messageBoxDisplayService;
            _serviceFactory = serviceFactory;

            InitializeComponent();
        }
        public PartsViewModel(IServiceFactory serviceFactory)
        {
            _serviceFactory = serviceFactory;

            EditPartCommand = new DelegateCommand<Part>(OnEditPartCommand);
            DeletePartCommand = new DelegateCommand<Part>(OnDeletePartCommand);
            AddPartCommand = new DelegateCommand<object>(OnAddPartCommand);
        }
        public OrdersViewModel(IServiceFactory serviceFactory)
        {
            _serviceFactory = serviceFactory;

            EditOrderCommand = new DelegateCommand<Order>(OnEditOrderCommand);
            DeleteOrderCommand = new DelegateCommand<Order>(OnDeleteOrderCommand);
            AddOrderCommand = new DelegateCommand<object>(OnAddOrderCommand);
        }
        public MaintainCarsViewModel(IServiceFactory serviceFactory)
        {
            _ServiceFactory = serviceFactory;

            EditCarCommand = new DelegateCommand<Car>(OnEditCarCommand);
            DeleteCarCommand = new DelegateCommand<Car>(OnDeleteCarCommand);
            AddCarCommand = new DelegateCommand<object>(OnAddCarCommand);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProducersAndMaterialsTabItemViewModel"/> class.
 /// </summary>
 /// <param name="modalDialogProvider">The modal dialog service.</param>
 /// <param name="serviceFactory">The service factory.</param>
 public RecipesTabItemViewModel(IMainViewModel mainViewModel, IModalDialogProvider modalDialogProvider, IServiceFactory serviceFactory)
     : base(mainViewModel, modalDialogProvider, serviceFactory)
 {
     RecipeDetailsViewModel = new RecipeDetailsViewModel(MainViewModel, ModalDialogProvider, ServiceFactory);
       RecipeListViewModel = new RecipeListViewModel(MainViewModel, RecipeDetailsViewModel, ModalDialogProvider, ServiceFactory);
       RecipeComponentDetailsViewModel = new RecipeComponentDetailsViewModel(MainViewModel, ModalDialogProvider, ServiceFactory);
       RecipeComponentListViewModel = new RecipeComponentListViewModel(MainViewModel, RecipeComponentDetailsViewModel, ModalDialogProvider, ServiceFactory);
 }
        public SuppliersViewModel(IServiceFactory serviceFactory)
        {
            _serviceFactory = serviceFactory;

            EditSupplierCommand = new DelegateCommand<Supplier>(OnEditSupplierCommand);
            DeleteSupplierCommand = new DelegateCommand<Supplier>(OnDeleteSupplierCommand);
            AddSupplierCommand = new DelegateCommand<object>(OnAddSupplierCommand);
        }
 public FrmCreateEditSiloEmptying(Guid id, IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
 {
     FormFactory = formFactory;
     _serviceFactory = serviceFactory;
     _stateController = stateController;
     _emptyingId = id;
     InitializeComponent();
 }
 public MyServiceHost(IServiceFactory factory, Type t, Uri[] baseAddresses)
     : base(t, baseAddresses)
 {
     foreach (var cd in ImplementedContracts.Values)
     {
         cd.Behaviors.Add(new MyInstanceProvider(factory));
     }
 }
 public FrmCreateEditBatchVaccine(Guid id, IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
 {
     FormFactory = formFactory;
     _serviceFactory = serviceFactory;
     _stateController = stateController;
     _batchVaccineId = id;
     InitializeComponent();
 }
Exemple #31
0
 public ServiceB(IServiceFactory serviceFactory)
 {
     ServiceFactory = serviceFactory;
 }
Exemple #32
0
        // ReSharper disable UnusedMember.Local
        private static Func <TArg1, TArg2, TArg3, TArg4, TService> CreateGenericGetNamedParameterizedInstanceDelegate <TArg1, TArg2, TArg3, TArg4, TService>(IServiceFactory factory, string serviceName)

        // ReSharper restore UnusedMember.Local
        {
            return((arg1, arg2, arg3, arg4) => factory.GetInstance <TArg1, TArg2, TArg3, TArg4, TService>(arg1, arg2, arg3, arg4, serviceName));
        }
Exemple #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseService"/> class.
 /// </summary>
 /// <param name="serviceFactory">The service factory.</param>
 public BaseService(IServiceFactory serviceFactory)
 {
     ServiceFactory = serviceFactory;
 }
Exemple #34
0
 public CreateTaskCommand(IServiceFactory factory)
 {
     _serviceFactory = factory;
 }
Exemple #35
0
 public MaintainCarsViewModel(IServiceFactory serviceFactory)
 {
     _ServiceFactory = serviceFactory;
 }
Exemple #36
0
 public InvoiceActor(ActorService actorService, ActorId actorId, IActorFactory actorFactory,
                     IServiceFactory serviceFactory)
     : base(actorService, actorId, actorFactory, serviceFactory)
 {
 }
Exemple #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SshClient"/> class.
 /// </summary>
 /// <param name="connectionInfo">The connection info.</param>
 /// <param name="ownsConnectionInfo">Specified whether this instance owns the connection info.</param>
 /// <param name="serviceFactory">The factory to use for creating new services.</param>
 /// <exception cref="ArgumentNullException"><paramref name="connectionInfo"/> is <c>null</c>.</exception>
 /// <exception cref="ArgumentNullException"><paramref name="serviceFactory"/> is <c>null</c>.</exception>
 /// <remarks>
 /// If <paramref name="ownsConnectionInfo"/> is <c>true</c>, then the
 /// connection info will be disposed when this instance is disposed.
 /// </remarks>
 internal SshClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
     : base(connectionInfo, ownsConnectionInfo, serviceFactory)
 {
     _forwardedPorts = new List <ForwardedPort>();
 }
Exemple #38
0
 public CreateModel(IServiceFactory serviceFactory)
 {
     this.serviceFactory = serviceFactory;
 }
Exemple #39
0
 internal CustomerService(IPaySimpleSettings settings, IValidationService validationService, IWebServiceRequest webServiceRequest, IServiceFactory serviceFactory)
     : base(settings, validationService, webServiceRequest, serviceFactory)
 {
 }
Exemple #40
0
 public RoleController(IServiceFactory serviceFactory)
     : base()
 {
     _userService = serviceFactory.UserService;
 }
 public ExpenseReportChargesViewModel(IServiceFactory serviceFactory)
     : base(serviceFactory)
 {
 }
 public FrmCreateEditBatchVaccine(Guid id, IFormFactory formFactory, IStateController stateController, IServiceFactory serviceFactory)
 {
     FormFactory      = formFactory;
     _serviceFactory  = serviceFactory;
     _stateController = stateController;
     _batchVaccineId  = id;
     InitializeComponent();
 }
 public SettingController(IServiceFactory serviceFactory) : base(serviceFactory, serviceFactory.SettingService)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CurrencyController"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="serviceFactory">
 /// The service factory.
 /// </param>
 public CurrencyController(IRepositoryFactory repositoryFactory, IServiceFactory serviceFactory) : base(repositoryFactory, serviceFactory)
 {
 }
 public HomeController(IServiceFactory serviceFactory) : base(serviceFactory)
 {
 }
 public EmployeeController(IEmployeeService _IEmployeeService, IServiceFactory serviceFactory) : base(serviceFactory)
 {
     _interface = _IEmployeeService;
 }
 public InternController(ILogger <InternController> logger, IMapper mapper, IServiceFactory factory)
 {
     _logger         = logger;
     _mapper         = mapper;
     _serviceFactory = factory;
 }
 public MyClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory) : base(connectionInfo, ownsConnectionInfo, serviceFactory)
 {
 }
Exemple #49
0
 public DashboardViewModel(IServiceFactory serviceFactory)
 {
     _ServiceFactory = serviceFactory;
 }
Exemple #50
0
 public DefaultServicePool(IServiceFactory <IOrganizationService> factory, PoolParams poolParams = null)
     : base(factory, poolParams)
 {
 }
Exemple #51
0
 public ProductsController(IServiceFactory factory) : base(factory)
 {
 }
Exemple #52
0
 public EventAggregator(Logger logger, IServiceFactory serviceFactory)
 {
     _logger         = logger;
     _serviceFactory = serviceFactory;
     _taskFactory    = new TaskFactory();
 }
 public ReturnThabService(IServiceFactory <IThabService> thabServiceFactory, IReturnCalculationService helper)
 {
     _thabService   = thabServiceFactory.GetService();
     _helperService = helper;
 }
 public AbstractPresenter(IKernel kernel, IServiceFactory serviceFactory, T view)
 {
     _kernel         = kernel;
     _serviceFactory = serviceFactory;
     _view           = view;
 }
 public CreateCompanyCommand(IServiceFactory serviceFactory)
 {
     _serviceFactory = serviceFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LightInjectServiceProvider"/> class.
 /// </summary>
 /// <param name="serviceFactory">The underlying <see cref="IServiceFactory"/>.</param>
 public LightInjectServiceProvider(IServiceFactory serviceFactory)
 {
     this.serviceFactory = serviceFactory;
 }
        private static async Task TestGetAllWithPagingOptionsSortDescendingAsync(IServiceFactory serviceFactory)
        {
            var service = serviceFactory.Create <Customer>();

            var entities = new List <Customer>();

            for (var i = 0; i < 21; i++)
            {
                entities.Add(new Customer {
                    Name = "Random Name " + i
                });
            }

            await service.CreateAsync(entities);

            var options     = new QueryOptions <Customer>().OrderByDescending(x => x.Id).Page(1, 5);
            var queryResult = await service.GetAllAsync(options);

            Assert.Equal(21, queryResult.Total);

            var entitiesInDb = queryResult.Result;

            Assert.Equal(5, entitiesInDb.Count());
            Assert.Equal("Random Name 20", entitiesInDb.ElementAt(0).Name);
            Assert.Equal("Random Name 19", entitiesInDb.ElementAt(1).Name);
            Assert.Equal("Random Name 18", entitiesInDb.ElementAt(2).Name);
            Assert.Equal("Random Name 17", entitiesInDb.ElementAt(3).Name);
            Assert.Equal("Random Name 16", entitiesInDb.ElementAt(4).Name);

            options = options.Page(2);

            entitiesInDb = (await service.GetAllAsync(options)).Result;

            Assert.Equal(5, entitiesInDb.Count());
            Assert.Equal("Random Name 15", entitiesInDb.ElementAt(0).Name);
            Assert.Equal("Random Name 14", entitiesInDb.ElementAt(1).Name);
            Assert.Equal("Random Name 13", entitiesInDb.ElementAt(2).Name);
            Assert.Equal("Random Name 12", entitiesInDb.ElementAt(3).Name);
            Assert.Equal("Random Name 11", entitiesInDb.ElementAt(4).Name);

            options = options.Page(3);

            entitiesInDb = (await service.GetAllAsync(options)).Result;

            Assert.Equal(5, entitiesInDb.Count());
            Assert.Equal("Random Name 10", entitiesInDb.ElementAt(0).Name);
            Assert.Equal("Random Name 9", entitiesInDb.ElementAt(1).Name);
            Assert.Equal("Random Name 8", entitiesInDb.ElementAt(2).Name);
            Assert.Equal("Random Name 7", entitiesInDb.ElementAt(3).Name);
            Assert.Equal("Random Name 6", entitiesInDb.ElementAt(4).Name);

            options = options.Page(4);

            entitiesInDb = (await service.GetAllAsync(options)).Result;

            Assert.Equal(5, entitiesInDb.Count());
            Assert.Equal("Random Name 5", entitiesInDb.ElementAt(0).Name);
            Assert.Equal("Random Name 4", entitiesInDb.ElementAt(1).Name);
            Assert.Equal("Random Name 3", entitiesInDb.ElementAt(2).Name);
            Assert.Equal("Random Name 2", entitiesInDb.ElementAt(3).Name);
            Assert.Equal("Random Name 1", entitiesInDb.ElementAt(4).Name);

            options = options.Page(5);

            entitiesInDb = (await service.GetAllAsync(options)).Result;

            Assert.Single(entitiesInDb);
            Assert.Equal("Random Name 0", entitiesInDb.ElementAt(0).Name);
        }
Exemple #58
0
 public DefaultServicePool(IServiceFactory <IOrganizationService> factory, int poolSize = 2, TimeSpan?tokenExpiryCheck = null)
     : this(factory, new PoolParams {
     PoolSize = poolSize, TokenExpiryCheck = tokenExpiryCheck
 })
 {
 }
 public abstract Task <object> HandleAsync(object request, CancellationToken ct,
                                           IServiceFactory serviceFactory);
Exemple #60
0
 public ContextFactory(IStorage storage, IUserServiceFactory userServiceFactory, IStateFactory stateFactory, IServiceFactory serviceFactory)
 {
     this.storage        = storage ?? throw new ArgumentNullException(nameof(storage));
     this.serviceFactory = serviceFactory ?? throw new ArgumentNullException(nameof(serviceFactory));
     this.stateFactory   = stateFactory ?? throw new ArgumentNullException(nameof(stateFactory));
     this.userService    = (IInitUserService)userServiceFactory.CreateUserService(new InitState());
 }