当前位置: 首页>>代码示例>>C#>>正文


C# IObjectFactory类代码示例

本文整理汇总了C#中IObjectFactory的典型用法代码示例。如果您正苦于以下问题:C# IObjectFactory类的具体用法?C# IObjectFactory怎么用?C# IObjectFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IObjectFactory类属于命名空间,在下文中一共展示了IObjectFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的IObjectFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。