本文整理汇总了C#中IServiceFactory类的典型用法代码示例。如果您正苦于以下问题:C# IServiceFactory类的具体用法?C# IServiceFactory怎么用?C# IServiceFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IServiceFactory类属于命名空间,在下文中一共展示了IServiceFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ServiceSynchronizationService
/// <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;
}
示例2: ManageDeliveryNotesViewModel
/// <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);
}
示例3: FrmAddStock
public FrmAddStock(IServiceFactory serviceFactory, IMessageBoxDisplayService messageBoxDisplayService)
{
_serviceFactory = serviceFactory;
_messageBoxDisplayService = messageBoxDisplayService;
InitializeComponent();
}
示例4: MainVM
public MainVM(IServiceFactory serviceFactory)
{
_ServiceFactory = serviceFactory;
MainVM._Instance = this;
_MainModel = new Model.MainModel();
Status = "Disconnected";
}
示例5: FrmCreateEditClient
public FrmCreateEditClient(Guid id, IFormFactory formFactory, IServiceFactory serviceFactory)
{
FormFactory = formFactory;
_serviceFactory = serviceFactory;
_clientId = id;
InitializeComponent();
}
示例6: Resource
/// <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);
}
}
}
示例7: RedisServer
public RedisServer(RedisConnection connection, string serviceQueue, IServiceFactory serviceFactory)
{
this.connection = connection;
this.serviceFactory = serviceFactory;
this.serviceQueue = serviceQueue;
this.receiveState = 0;
}
示例8: MessagingServer
/// <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;
}
示例9: AudioController
public AudioController(IServiceFactory ninjectFactory)
{
if (ninjectFactory == null)
throw new ArgumentNullException(nameof(ninjectFactory));
_tracksService = ninjectFactory.CreateTracksService();
}
示例10: ManageOrdersViewModel
/// <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);
}
示例11: DashboardController
public DashboardController(IServiceFactory factory,
IProcess<OrgMemberDocVisibilityByOrgAdminParams, GeneralSuccessResultViewModel> orgDocVisibilityProcess)
{
_serviceFactory = factory;
_unitOfWork = factory.GetService<IUnitOfWork>();
_orgDocVisibilityProcess = orgDocVisibilityProcess;
}
示例12: ReservationsViewModel
public ReservationsViewModel(IServiceFactory serviceFactory)
{
_ServiceFactory = serviceFactory;
ExecuteRentalCommand = new DelegateCommand<int>(OnExecuteRentalCommandExecute);
CancelReservationCommand = new DelegateCommand<int>(OnCancelReservationCommandExecute);
}
示例13: EditOrderViewModel
// 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);
}
示例14: BaseParameter
/// <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");
}
示例15: DefineProxyType
private void DefineProxyType(IServiceFactory servicefactory, ProxyDefinition proxyDefinition)
{
//container.Register<ILogFactory, LogFactory>();
//container.Register<ILogBase,log.Logger>();
proxyDefinition.Implement(() => servicefactory.GetInstance<IInterceptor>("LogInterceptor"));
}