本文整理汇总了C#中IObjectFactory类的典型用法代码示例。如果您正苦于以下问题:C# IObjectFactory类的具体用法?C# IObjectFactory怎么用?C# IObjectFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IObjectFactory类属于命名空间,在下文中一共展示了IObjectFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Context
//private readonly IRepositoryBulkReader BulkReader;
//private readonly Lazy<World>[] LazyWorlds = new Lazy<World>[512];
public Context(IObjectFactory factory, IDatabaseQueryManager manager)
{
var scope = factory.CreateScope(null);
scope.RegisterInterfaces(manager.StartQuery(false));
WorldRepository = scope.Resolve<IPersistableRepository<World>>();
FortuneRepository = scope.Resolve<IQueryableRepository<Fortune>>();
//BulkReader = scope.BulkRead(ChunkedMemoryStream.Static());
}
开发者ID:TechEmpower,项目名称:FrameworkBenchmarks,代码行数:11,代码来源:Context.cs
示例2: PollAnswerViewModel
public PollAnswerViewModel(IPoll poll,
IObjectFactory<IPollOption> objectFactory, short optionPosition)
{
this.poll = poll;
this.objectFactory = objectFactory;
this.optionPosition = optionPosition;
}
开发者ID:kamilkk,项目名称:MyVote,代码行数:7,代码来源:PollAnswerViewModel.cs
示例3: Initialize
public void Initialize(IObjectFactory factory)
{
if (!LogCommands)
return;
factory.RegisterTypes(new[] { typeof(ProcessingCommandsIntercepter), typeof(RestCommandsIntercepter) });
var processingInterceptor = factory.Resolve<ProcessingCommandsIntercepter>();
var restInterceptor = factory.Resolve<RestCommandsIntercepter>();
var aspectRegistrator = factory.Resolve<IAspectRegistrator>();
var tpe = typeof(IProcessingEngine);
var tcc = typeof(ICommandConverter);
var tre = typeof(IRestApplication);
aspectRegistrator.Before(
tpe,
tpe.GetMethod("Execute"),
(e, args) => processingInterceptor.LogCommands((dynamic)(args[0])));
aspectRegistrator.Around(
tcc,
tcc.GetMethod("PassThrough"),
(e, args, baseCall) => restInterceptor.PassThrough(args, baseCall));
aspectRegistrator.Around<IRestApplication, Stream>(
r => r.Get(),
restInterceptor.Get);
aspectRegistrator.Around<IRestApplication, Stream, Stream>(
r => r.Post(null),
(_, s, bc) => restInterceptor.Post(s, bc));
}
开发者ID:rinmalavi,项目名称:revenj,代码行数:27,代码来源:Configuration.cs
示例4: DefaultActivator
public DefaultActivator(IObjectFactory objectFactory, IServiceDependencyInspector serviceDependencyInspector, IServiceEntryResolver serviceEntryResolver, ServiceEntry entry)
{
_objectFactory = objectFactory;
_serviceEntryResolver = serviceEntryResolver;
_serviceDependencyInspector = serviceDependencyInspector;
_entry = entry;
}
开发者ID:benlovell,项目名称:machine,代码行数:7,代码来源:DefaultActivator.cs
示例5: Initialize
public virtual void Initialize([NotNull] Type interfaceType, IObjectFactory objectFactory)
{
Assert.ArgumentNotNull(interfaceType, "interfaceType");
Assert.ArgumentNotNull(objectFactory, "objectFactory");
this.InterfaceType = interfaceType;
this.ObjectFactory = objectFactory;
}
开发者ID:Zvirja,项目名称:TrayGarden,代码行数:7,代码来源:Mapping.cs
示例6: SecurityApplicationProcessingRule
public SecurityApplicationProcessingRule(ISecurityAuthorizationProvider securityAuthorizationProvider, IGenericRepository genericRepository, ISecurityContext securityContext, IObjectFactory objectFactory)
{
_securityAuthorizationProvider = securityAuthorizationProvider;
_genericRepository = genericRepository;
_securityContext = securityContext;
_objectFactory = objectFactory;
}
开发者ID:johnbrunnings,项目名称:Neat,代码行数:7,代码来源:SecurityApplicationProcessingRule.cs
示例7: DomainModel
public DomainModel(
IEnumerable<Assembly> assemblies,
IObjectFactory objectFactory)
{
Contract.Requires(assemblies != null);
Contract.Requires(objectFactory != null);
DomainAssemblies = assemblies.ToList();
try
{
foreach (var asm in assemblies)
foreach (var type in asm.GetTypes())
if (typeof(ISystemAspect).IsAssignableFrom(type))
{
var aspect = (ISystemAspect)Activator.CreateInstance(type);
aspect.Initialize(objectFactory);
}
}
catch (ReflectionTypeLoadException ex)
{
var first = (ex.LoaderExceptions ?? new Exception[0]).Take(5).ToList();
throw new ApplicationException(string.Format(@"Can't load types:
{0}
", string.Join(Environment.NewLine, first.Select(it => it.Message))), ex);
}
}
开发者ID:instant-hrvoje,项目名称:revenj,代码行数:27,代码来源:DomainModel.cs
示例8: Start
public static IDomainModel Start(IObjectFactory factory)
{
var init = factory.Resolve<SystemInitialization>();
init.Initialize(false);
//TODO change domain model boot. export to ISystemAspect to avoid explicit initialization
return factory.Resolve<IDomainModel>();
}
开发者ID:nutrija,项目名称:revenj,代码行数:7,代码来源:DryIocConfiguration.cs
示例9: PatientDetailViewController
public PatientDetailViewController(IObjectFactory objectFactory)
{
this.ObjectFactory = objectFactory;
this.PatientManager = this.ObjectFactory.Create<IPatientManager>();
this.navBar = new UINavigationBar(new RectangleF(0,0,768, 44));
this.navBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
this.navBar.SetItems(
new[]
{
new UINavigationItem("Patient Information")
},false);
this.navBar.TopItem.SetRightBarButtonItem(this.EditButtonItem, false);
this.View.BackgroundColor = UIColor.LightGray;
this.View.Frame = new RectangleF(0,0,768,768);
this.patientDetailView = this.ObjectFactory.Create<PatientDetailView>();
this.patientDetailView.Frame = new RectangleF(0,44,this.colWidth1 + this.colWidth2, 728);
this.patientDetailView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight;
this.View.AddSubview (this.patientDetailView);
this.View.AddSubview (this.navBar);
}
开发者ID:DnyaneshwarWadghanePM,项目名称:notes-for-nurses-redux,代码行数:25,代码来源:PatientDetailViewController.cs
示例10: CreateSession
public ISession CreateSession(IDictionary<string, string> parameters, IObjectFactory objectFactory, AbstractAuthenticationProvider authenticationProvider, ICache cache)
{
Session session = new Session(parameters, objectFactory, authenticationProvider, cache);
session.Connect();
return session;
}
开发者ID:emrul,项目名称:CmisSync,代码行数:7,代码来源:client-impl.cs
示例11: ScopePool
public ScopePool(
IObjectFactory factory,
IDatabaseQueryManager queries,
IExtensibilityProvider extensibilityProvider)
{
this.Factory = factory;
this.Queries = queries;
if (!int.TryParse(ConfigurationManager.AppSettings["Processing.PoolSize"], out Size))
Size = 20;
if (!Enum.TryParse<PoolMode>(ConfigurationManager.AppSettings["Processing.PoolMode"], out Mode))
{
//TODO: Mono has issues with BlockingCollection. use None as default
int p = (int)Environment.OSVersion.Platform;
if (p == 4 || p == 6 || p == 128)
Mode = PoolMode.None;
else
Mode = PoolMode.IfAvailable;
}
var commandTypes = extensibilityProvider.FindPlugins<IServerCommand>();
Factory.RegisterTypes(commandTypes, InstanceScope.Context);
if (Mode != PoolMode.None)
{
if (Size < 1) Size = 1;
for (int i = 0; i < Size; i++)
Scopes.Add(SetupReadonlyScope());
}
}
开发者ID:instant-hrvoje,项目名称:revenj,代码行数:27,代码来源:ScopePool.cs
示例12: DeployDependenciesTask
public DeployDependenciesTask(
string projectName,
string targetEnvironment,
Guid deploymentId,
IProjectInfoRepository projectInfoRepository,
IObjectFactory objectFactory,
ITeamCityRestClient temCityRestClient,
IDependentProjectsToDeployWebSelector dependentProjectsToDeploySelector)
{
Guard.NotNullNorEmpty(projectName, "projectName");
Guard.NotNullNorEmpty(targetEnvironment, "targetEnvironment");
Guard.NotEmpty(deploymentId, "deploymentId");
Guard.NotNull(projectInfoRepository, "projectInfoRepository");
Guard.NotNull(objectFactory, "objectFactory");
Guard.NotNull(temCityRestClient, "temCityRestClient");
Guard.NotNull(dependentProjectsToDeploySelector, "dependentProjectsToDeploySelector");
_projectName = projectName;
_targetEnvironment = targetEnvironment;
_deploymentId = deploymentId;
_projectInfoRepository = projectInfoRepository;
_objectFactory = objectFactory;
_temCityRestClient = temCityRestClient;
_dependentProjectsToDeploySelector = dependentProjectsToDeploySelector;
_subTasks = new List<DeploymentTaskBase>();
}
开发者ID:spawluk,项目名称:UberDeployer,代码行数:27,代码来源:DeployDependenciesTask.cs
示例13: RunGlobalManagers
private static void RunGlobalManagers(IObjectFactory objectFactory)
{
// run market manager.
objectFactory.GetMarketManager();
// start pool manager.
objectFactory.GetPoolManager();
// run algorithm manager.
objectFactory.GetAlgorithmManager();
// run payment manager
objectFactory.GetPaymentDaemonManager();
// run statistics manager.
objectFactory.GetStatisticsManager();
// run software repository.
objectFactory.GetSoftwareRepository();
#if DEBUG
// only initialize metrics support in debug mode
objectFactory.GetMetricsManager();
#endif
// start web server.
objectFactory.GetWebServer();
}
开发者ID:carloslozano,项目名称:CoiniumServ,代码行数:28,代码来源:Program.cs
示例14: PollResultsPageViewModel
public PollResultsPageViewModel(
INavigation navigation,
IObjectFactory<IPollResults> objectFactory,
IObjectFactory<IPoll> pollFactory,
IObjectFactory<IPollComment> pollCommentFactory,
IMessageBox messageBox
#if NETFX_CORE
, IShareManager shareManager,
ISecondaryPinner secondaryPinner
#endif // NETFX_CORE
)
: base(navigation)
{
this.objectFactory = objectFactory;
this.pollFactory = pollFactory;
this.pollCommentFactory = pollCommentFactory;
this.messageBox = messageBox;
this.PollComments = new ObservableCollection<PollCommentViewModel>();
#if NETFX_CORE
this.shareManager = shareManager;
this.secondaryPinner = secondaryPinner;
#endif // NETFX_CORE
}
开发者ID:kamilkk,项目名称:MyVote,代码行数:25,代码来源:PollResultsPageViewModel.cs
示例15: AGSUIFactory
public AGSUIFactory(IContainer resolver, IGameState gameState, IGraphicsFactory graphics, IObjectFactory obj)
{
_resolver = resolver;
_gameState = gameState;
_graphics = graphics;
_object = obj;
}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:AGSUIFactory.cs
示例16: AlgorithmManager
public AlgorithmManager(IPoolManager poolManager, IObjectFactory objectFactory)
{
_storage = new List<IHashAlgorithmStatistics>();
// add algorithms
foreach (var pool in poolManager.GetAll())
{
var query = _storage.FirstOrDefault(x => x.Name == pool.Config.Coin.Algorithm);
if (query != null)
continue;
var statistics = objectFactory.GetHashAlgorithmStatistics(pool.Config.Coin.Algorithm);
_storage.Add(statistics);
}
// assign pools to hash algorithms
foreach (var item in _storage)
{
var algorithm = item;
var pools = poolManager.GetAll().Where(p => p.Config.Coin.Algorithm == algorithm.Name);
algorithm.AssignPools(pools);
}
}
开发者ID:icede,项目名称:CoiniumServ-develop,代码行数:25,代码来源:AlgorithmManager.cs
示例17: AGSDialogFactory
public AGSDialogFactory(IContainer resolver, IGameState gameState, IUIFactory ui, IObjectFactory obj)
{
_resolver = resolver;
_gameState = gameState;
_ui = ui;
_object = obj;
}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:AGSDialogFactory.cs
示例18: BuildProxyType
public virtual Type BuildProxyType(IObjectFactory objectFactory)
{
Type proxyType = null;
if (useServiceProxyTypeCache)
{
lock (s_serviceTypeCache)
{
proxyType = (Type)s_serviceTypeCache[this.Name];
if (proxyType == null)
{
proxyType = BuildProxyType();
s_serviceTypeCache[this.Name] = proxyType;
}
}
}
else
{
proxyType = BuildProxyType();
}
FieldInfo field = proxyType.GetField("__objectFactory", BindingFlags.NonPublic | BindingFlags.Static);
field.SetValue(proxyType, objectFactory);
return proxyType;
}
开发者ID:pampero,项目名称:cgFramework,代码行数:25,代码来源:ServiceProxyTypeBuilder.cs
示例19: DefaultBuddyBuilder
public DefaultBuddyBuilder(IImManagerInternal imManager, IObjectFactory objectFactory)
{
Helper.GuardNotNull(imManager);
Helper.GuardNotNull(objectFactory);
_imManager = imManager;
_objectFactory = objectFactory;
}
开发者ID:percramer,项目名称:pjsip4net,代码行数:7,代码来源:DefaultBuddyBuilder.cs
示例20: PollsPageViewModel
public PollsPageViewModel(
INavigation navigation,
IObjectFactory<IPollSearchResults> objectFactory)
: base(navigation)
{
this.objectFactory = objectFactory;
this.SearchOptions = new ObservableCollection<PollSearchOptionViewModel>();
}
开发者ID:kamilkk,项目名称:MyVote,代码行数:8,代码来源:PollsPageViewModel.cs
注:本文中的IObjectFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论