//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());
		}
示例#2
0
		public PollAnswerViewModel(IPoll poll,
			IObjectFactory<IPollOption> objectFactory, short optionPosition)
		{
			this.poll = poll;
			this.objectFactory = objectFactory;
			this.optionPosition = optionPosition;
		}
示例#3
0
        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));
        }
示例#4
0
文件: Core.cs 项目: jonaspp/Tree
 static Core()
 {
     injector = new ObjectInjectorImpl();
     factory = new ObjectFactoryImpl();
     container = new ObjectContainerImpl();
     container.Start();
 }
示例#5
0
 public void WarmUp_Singleton()
 {
     k = new XmlObjectFactory(new InputStreamResource(new MemoryStream(Encoding.UTF8.GetBytes(CONFIG_SINGLETON)), "config"));
     // k = new XmlApplicationContext("file://SpringConfig.xml");
     // var ctx = new GenericApplicationContext();
     // ctx.RegisterObjectDefinition
 }
示例#6
0
 public DefaultActivator(IObjectFactory objectFactory, IServiceDependencyInspector serviceDependencyInspector, IServiceEntryResolver serviceEntryResolver, ServiceEntry entry)
 {
     _objectFactory = objectFactory;
       _serviceEntryResolver = serviceEntryResolver;
       _serviceDependencyInspector = serviceDependencyInspector;
       _entry = entry;
 }
示例#7
0
 public virtual void Initialize([NotNull] Type interfaceType, IObjectFactory objectFactory)
 {
     Assert.ArgumentNotNull(interfaceType, "interfaceType");
       Assert.ArgumentNotNull(objectFactory, "objectFactory");
       this.InterfaceType = interfaceType;
       this.ObjectFactory = objectFactory;
 }
示例#8
0
        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();
        }
 public DefaultBuddyBuilder(IImManagerInternal imManager, IObjectFactory objectFactory)
 {
     Helper.GuardNotNull(imManager);
     Helper.GuardNotNull(objectFactory);
     _imManager = imManager;
     _objectFactory = objectFactory;
 }
        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>();
        }
示例#11
0
 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());
     }
 }
示例#12
0
        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;
        }
        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);
		}
示例#14
0
 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>();
 }
示例#15
0
        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);
            }
        }
 public SecurityApplicationProcessingRule(ISecurityAuthorizationProvider securityAuthorizationProvider, IGenericRepository genericRepository, ISecurityContext securityContext, IObjectFactory objectFactory)
 {
     _securityAuthorizationProvider = securityAuthorizationProvider;
     _genericRepository = genericRepository;
     _securityContext = securityContext;
     _objectFactory = objectFactory;
 }
        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;
        }
示例#18
0
		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
		}
示例#19
0
		public AGSUIFactory(IContainer resolver, IGameState gameState, IGraphicsFactory graphics, IObjectFactory obj)
		{
			_resolver = resolver;
			_gameState = gameState;
			_graphics = graphics;
			_object = obj;
		}
        //public static void Init(IApplicationContext ctx)
        //{
        //    factory = ctx;
        //}
        public override IController CreateController(RequestContext context, string controllerName)
        {
            try
            {
                if (factory == null)
                    factory = ContextRegistry.GetContext();
                var controllerNameFix = controllerName.Split('-')[0].Split('.')[0];
                var controller = (SearcherController)factory.GetObject(controllerNameFix + "Controller");
                //controller.SiteName = context.RouteData.Values["site"].ToString();
                //if (context.RouteData.Values["action"] == null || context.RouteData.Values["action"].ToString() == "index")
                //    context.RouteData.Values["action"] = "search";

                var iSearchMethods = typeof (ISearch).GetMethods().Select(x => x.Name);

                if(context.RouteData.Values["query"]!=null)
                    if (iSearchMethods.Contains(context.RouteData.Values["query"].ToString()) || context.RouteData.Values["query"].ToString().ToLower()=="print")
                    {
                        context.RouteData.Values["action"] = context.RouteData.Values["query"];
                    }

                context.RouteData.Values["controller"] = controllerNameFix;
                controller.SiteName = "clarin";
                return controller;
            }
            // If the controller is not configured, fall back to base class.
            catch (Exception e)
            {
               return base.CreateController(context, controllerName);
            }
        }
        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);
            }
        }
示例#22
0
		public AGSDialogFactory(IContainer resolver, IGameState gameState, IUIFactory ui, IObjectFactory obj)
		{
			_resolver = resolver;
			_gameState = gameState;
			_ui = ui;
			_object = obj;
		}
示例#23
0
		public PollsPageViewModel(
			INavigation navigation,
			IObjectFactory<IPollSearchResults> objectFactory)
			: base(navigation)
		{
			this.objectFactory = objectFactory;
			this.SearchOptions = new ObservableCollection<PollSearchOptionViewModel>();
		}
		public void SetUp()
		{
			var doc = new XmlDocument();
			doc.LoadXml(ObjectsConfigXml);
			var configHandler = new ObjectsConfigurationSectionHandler();
			var objectConfigTypes = (Dictionary<string, ObjectConfigurationType>)configHandler.Create(null, null, doc.DocumentElement);
			factory = FactoryUtils.CreateObjectFactoryFromConfig(objectConfigTypes);
		}
 public SecurityAuthorizationProvider(ISecurityAccessTokenProvider securityAccessTokenProvider, ISecurityACLProvider securityACLProvider, ISecurityPermissionProvider securityPermissionProvider, ISecurityContext securityContext, IObjectFactory objectFactory)
 {
     _securityAccessTokenProvider = securityAccessTokenProvider;
     _securityACLProvider = securityACLProvider;
     _securityPermissionProvider = securityPermissionProvider;
     _securityContext = securityContext;
     _objectFactory = objectFactory;
 }
		/// <summary>
		/// Creates a new instance of the
		/// <see cref="ArgumentNullException"/>
		/// class.
		/// </summary>
		/// <remarks>
		/// <p>
		/// This is an <see lang="abstract"/> class, and as such has no
		/// publicly visible constructors.
		/// </p>
		/// </remarks>
		/// <param name="objectDefinition">
		/// The object definition that is the target of the method replacement.
		/// </param>
		/// <param name="objectFactory">
		/// The enclosing IoC container with which the above
		/// <paramref name="objectDefinition"/> is associated.
		/// </param>
		/// <exception cref="AbstractMethodReplacer">
		/// If either of the supplied arguments is <see langword="null"/>.
		/// </exception>
		protected AbstractMethodReplacer(
            IConfigurableObjectDefinition objectDefinition, IObjectFactory objectFactory)
		{
			AssertUtils.ArgumentNotNull(objectDefinition, "objectDefinition");
			AssertUtils.ArgumentNotNull(objectFactory, "objectFactory");
			this.objectDefinition = objectDefinition;
			this.objectFactory = objectFactory;
		}
        /// <summary>
        /// Parse string as 'Double' and return a factory specific number wrapper.
        /// </summary>
        internal static object ParseDouble(IObjectFactory factory, string data)
        {
            Double number;

            if (NumericHelper.TryParseDouble(data, NumberStyles.Float, out number))
                return factory.CreateNumber(number);
            return null;
        }
 public StartupManager(
     IFileManager fileManager, 
     IObjectFactory objectFactory, 
     IScreenController screenController)
 {
     FileManager = fileManager;
     ObjectFactory = objectFactory;
     ScreenController = screenController;
 }
示例#29
0
        public Statistics(IObjectFactory statisticsObjectFactory)
        {
            Pools = statisticsObjectFactory.GetPoolStats();
            Global = statisticsObjectFactory.GetGlobalStatistics();
            Algorithms = statisticsObjectFactory.GetAlgorithmStatistics();

            _timer = new Timer(Recache, null, Timeout.Infinite, Timeout.Infinite); // create the timer as disabled.
            Recache(null); // recache data initially.
        }
 public override void Setup()
 {
     base.Setup();
       _entry = ServiceEntryHelper.NewEntry();
       _objectFactory = _mocks.StrictMock<IObjectFactory>();
       _serviceDependencyInspector = _mocks.DynamicMock<IServiceDependencyInspector>();
       _serviceEntryResolver = _mocks.DynamicMock<IServiceEntryResolver>();
       _activatorFactory = new DefaultActivatorFactory(_objectFactory, _serviceDependencyInspector, _serviceEntryResolver);
 }
示例#31
0
 /// <summary>
 /// Instantiate an instance of the object described by the supplied
 /// <paramref name="definition"/> from the supplied <paramref name="factory"/>,
 /// injecting methods as appropriate.
 /// </summary>
 /// <param name="definition">
 /// The definition of the object that is to be instantiated.
 /// </param>
 /// <param name="objectName">
 /// The name associated with the object definition. The name can be the
 /// <see lang="null"/> or zero length string if we're autowiring an
 /// object that doesn't belong to the supplied
 /// <paramref name="factory"/>.
 /// </param>
 /// <param name="factory">
 /// The owning <see cref="Spring.Objects.Factory.IObjectFactory"/>
 /// </param>
 /// <param name="constructor">
 /// The <see cref="System.Reflection.ConstructorInfo"/> to be used to instantiate
 /// the object.
 /// </param>
 /// <param name="arguments">
 /// Any arguments to the supplied <paramref name="constructor"/>. May be null.
 /// </param>
 /// <returns>
 /// An instance of the object described by the supplied
 /// <paramref name="definition"/> from the supplied <paramref name="factory"/>.
 /// </returns>
 /// <seealso cref="Spring.Objects.Factory.Support.SimpleInstantiationStrategy.InstantiateWithMethodInjection(RootObjectDefinition, string, IObjectFactory, ConstructorInfo, object[])"/>
 protected override object InstantiateWithMethodInjection(
     RootObjectDefinition definition, string objectName, IObjectFactory factory, ConstructorInfo constructor, object[] arguments)
 {
     return(DoInstantiate(definition, objectName, factory, ReflectionUtils.GetParameterTypes(constructor), arguments));
 }
 internal static IGeometry ToGeometry(this string wkt, IObjectFactory objectFactory)
 {
     return(BuildGeometry(wkt, objectFactory));
 }
 /// <summary>
 /// Initialize this instance with the predefined <paramref name="targetObjectName"/> and <paramref name="objectFactory"/>.
 /// </summary>
 /// <param name="targetObjectName"></param>
 /// <param name="objectFactory"></param>
 public ObjectReferenceFactoryObject(string targetObjectName, IObjectFactory objectFactory)
 {
     this.TargetObjectName = targetObjectName;
     this.ObjectFactory    = objectFactory;
 }
 public void SetUp()
 {
     this.ObjectFactory = new XmlObjectFactory(
         new ReadOnlyXmlTestResource("hotSwapTests.xml", GetType()));
 }
示例#35
0
        public void InstantiationWithNullDefinition()
        {
            IObjectFactory factory = (IObjectFactory)mocks.CreateMock(typeof(IObjectFactory));

            new DelegatingMethodReplacer(null, factory);
        }
示例#36
0
 public IList <IRepository> GetRepositories(IDictionary <string, string> parameters, IObjectFactory objectFactory, IAuthenticationProvider authenticationProvider, ICache cache)
 {
     return(DefaultSessionFactory.GetRepositories(AddWindowClasses(parameters), objectFactory, authenticationProvider, cache));
 }
示例#37
0
 public TurboFactory(IObjectFactory objectFactory, IInfoProvider infoProvider)
 {
     _objectFactory = objectFactory;
     _infoProvider  = infoProvider;
 }
示例#38
0
 /// <summary>
 /// Creates a new instance of the <see cref="Spring.ServiceModel.SpringWebServiceHost"/> class.
 /// </summary>
 /// <param name="serviceName">The name of the service within Spring's IoC container.</param>
 /// <param name="objectFactory">The <see cref="IObjectFactory"/> to use.</param>
 /// <param name="useServiceProxyTypeCache">Whether to cache the generated service proxy type.</param>
 /// <param name="baseAddresses">The base addresses for the hosted service.</param>
 public SpringWebServiceHost(string serviceName, IObjectFactory objectFactory, bool useServiceProxyTypeCache, params Uri[] baseAddresses)
     : base(CreateServiceType(serviceName, objectFactory, useServiceProxyTypeCache), baseAddresses)
 {
 }
示例#39
0
 /// <summary>
 /// Creates a new instance of the <see cref="Spring.ServiceModel.SpringWebServiceHost"/> class.
 /// </summary>
 /// <param name="serviceName">The name of the service within Spring's IoC container.</param>
 /// <param name="objectFactory">The <see cref="IObjectFactory"/> to use.</param>
 /// <param name="baseAddresses">The base addresses for the hosted service.</param>
 public SpringWebServiceHost(string serviceName, IObjectFactory objectFactory, params Uri[] baseAddresses)
     : this(serviceName, objectFactory, true, baseAddresses)
 {
 }
 public NonGenericDictionaryNodeDeserializer(IObjectFactory objectFactory)
 {
     _objectFactory = objectFactory;
 }
 public PayloadValidatorInvoker(IObjectFactory objectFactory)
 {
     _objectFactory = objectFactory;
 }
示例#42
0
 public DownloadableFilesService(IObjectFactory objectFactory, IRepository <File> files)
     : base(objectFactory)
 {
     this.files = files;
 }
示例#43
0
 public ManagedGameObject_Deserializer(ITypeInspector typeDescriptor, IObjectFactory objectFactory = null)
 {
     this.typeDescriptor = (typeDescriptor ?? throw new ArgumentNullException("typeDescriptor"));
     this.objectFactory  = (objectFactory ?? new YamlDotNet.Serialization.ObjectFactories.DefaultObjectFactory());
 }
示例#44
0
 /// <summary>
 /// Instantiate an instance of the object described by the supplied
 /// <paramref name="definition"/> from the supplied <paramref name="factory"/>,
 /// injecting methods as appropriate.
 /// </summary>
 /// <param name="definition">
 /// The definition of the object that is to be instantiated.
 /// </param>
 /// <param name="objectName">
 /// The name associated with the object definition. The name can be the
 /// <see lang="null"/> or zero length string if we're autowiring an
 /// object that doesn't belong to the supplied
 /// <paramref name="factory"/>.
 /// </param>
 /// <param name="factory">
 /// The owning <see cref="Spring.Objects.Factory.IObjectFactory"/>
 /// </param>
 /// <returns>
 /// An instance of the object described by the supplied
 /// <paramref name="definition"/> from the supplied <paramref name="factory"/>.
 /// </returns>
 /// <seealso cref="Spring.Objects.Factory.Support.SimpleInstantiationStrategy.InstantiateWithMethodInjection(RootObjectDefinition, string, IObjectFactory)"/>
 protected override object InstantiateWithMethodInjection(
     RootObjectDefinition definition, string objectName, IObjectFactory factory)
 {
     return(DoInstantiate(definition, objectName, factory, Type.EmptyTypes, ObjectUtils.EmptyObjects));
 }
示例#45
0
 public FactoryProvider(IObjectFactory factory, params object[] providers)
     : this(factory)
 {
     RegisterAll(providers);
 }
 public YamlConvertibleNodeDeserializer(IObjectFactory objectFactory)
 {
     this.objectFactory = objectFactory;
 }
示例#47
0
 public PaddedEndsDecorator(Obstacle obstacle, IObjectFactory objectFactory)
 {
     _obstacle      = obstacle;
     _objectFactory = objectFactory;
 }
        public void Initialize(IObjectFactory factory)
        {
            {
                var       dbTranConf = factory.Resolve <IDatabaseQueryManager>();
                var       dbQuery    = dbTranConf.CreateQuery();
                DataTable columnsInfo;
                try { columnsInfo = dbQuery.Fill(@"SELECT * FROM ""-DSL-"".Load_Type_Info()"); }
                catch { columnsInfo = dbQuery.Fill(@"SELECT 
	ns.nspname::varchar as type_schema, 
	cl.relname::varchar as type_name, 
	atr.attname::varchar as column_name, 
	ns_ref.nspname::varchar as column_schema,
	typ.typname::varchar as column_type, 
	(SELECT COUNT(*) + 1
	FROM pg_attribute atr_ord
	WHERE 
		atr.attrelid = atr_ord.attrelid
		AND atr_ord.attisdropped = false
		AND atr_ord.attnum > 0
		AND atr_ord.attnum < atr.attnum)::smallint as column_index, 
	atr.attnotnull as is_not_null,
	coalesce(d.description LIKE 'NGS generated%', false) as is_ngs_generated
FROM 
	pg_attribute atr
	INNER JOIN pg_class cl ON atr.attrelid = cl.oid
	INNER JOIN pg_namespace ns ON cl.relnamespace = ns.oid
	INNER JOIN pg_type typ ON atr.atttypid = typ.oid
	INNER JOIN pg_namespace ns_ref ON typ.typnamespace = ns_ref.oid
	LEFT JOIN pg_description d ON d.objoid = cl.oid
								AND d.objsubid = atr.attnum
WHERE
	(cl.relkind = 'r' OR cl.relkind = 'v' OR cl.relkind = 'c')
	AND ns.nspname NOT LIKE 'pg_%'
	AND ns.nspname != 'information_schema'
	AND atr.attnum > 0
	AND atr.attisdropped = FALSE
ORDER BY 1, 2, 6"); }
                columnsInfo.CaseSensitive = true;
                columnsInfo.PrimaryKey    = new[] { columnsInfo.Columns[0], columnsInfo.Columns[1], columnsInfo.Columns[2] };
                _DatabaseConfiguration.DatabaseConverters.Initialize(columnsInfo);
                dbTranConf.EndQuery(dbQuery, false);
            }
            var postgresConverter = factory.Resolve <IPostgresConverterRepository>();

            postgresConverter.RegisterConverter(typeof(global::UseCase1.FormGroup), new _DatabaseCommon.FactoryUseCase1_FormGroup.FormGroupConverter());
            DatabaseRepositoryUseCase1.RegisterFormGroup.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::UseCase1.Form), new _DatabaseCommon.FactoryUseCase1_Form.FormConverter());
            DatabaseRepositoryUseCase1.RegisterForm.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::UseCase1.FormList), new _DatabaseCommon.FactoryUseCase1_FormList.FormListConverter());
            DatabaseRepositoryUseCase1.RegisterFormList.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::UseCase1.Entry), new _DatabaseCommon.FactoryUseCase1_Entry.EntryConverter());
            postgresConverter.RegisterConverter(typeof(global::UseCase1.Customer), new _DatabaseCommon.FactoryUseCase1_Customer.CustomerConverter());
            DatabaseRepositoryUseCase1.RegisterCustomer.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::UseCase1.Submission), new _DatabaseCommon.FactoryUseCase1_Submission.SubmissionConverter());
            DatabaseRepositoryUseCase1.RegisterSubmission.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::UseCase1.SubmissionList), new _DatabaseCommon.FactoryUseCase1_SubmissionList.SubmissionListConverter());
            DatabaseRepositoryUseCase1.RegisterSubmissionList.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::FormABC.Input), new _DatabaseCommon.FactoryFormABC_Input.InputConverter());
            DatabaseRepositoryFormABC.RegisterInput.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::FormABC.Output), new _DatabaseCommon.FactoryFormABC_Output.OutputConverter());
            DatabaseRepositoryFormABC.RegisterOutput.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::FormXYZ.Input), new _DatabaseCommon.FactoryFormXYZ_Input.InputConverter());
            DatabaseRepositoryFormXYZ.RegisterInput.Register(factory);
            postgresConverter.RegisterConverter(typeof(global::FormXYZ.Output), new _DatabaseCommon.FactoryFormXYZ_Output.OutputConverter());
            DatabaseRepositoryFormXYZ.RegisterOutput.Register(factory);
        }
示例#49
0
 public ISession CreateSession(IDictionary <string, string> parameters, IObjectFactory objectFactory, IAuthenticationProvider authenticationProvider, ICache cache)
 {
     return(DefaultSessionFactory.CreateSession(AddWindowClasses(parameters), objectFactory, authenticationProvider, cache));
 }
 /// <summary>
 /// Creates a new instance of the <see cref="XmlObjectFactory"/> class,
 /// with the given resource, which must be parsable using DOM, and the
 /// given parent factory.
 /// </summary>
 /// <param name="resource">
 /// The XML resource to load object definitions from.
 /// </param>
 /// <param name="parentFactory">The parent object factory (may be <see langword="null"/>).</param>
 /// <exception cref="Spring.Objects.ObjectsException">
 /// In the case of loading or parsing errors.
 /// </exception>
 public XmlObjectFactory(
     IResource resource, IObjectFactory parentFactory)
     : this(resource, true, parentFactory)
 {
 }
 public NonGenericListNodeDeserializer(IObjectFactory objectFactory)
 {
     _objectFactory = objectFactory;
 }
示例#52
0
 public NavigationFrameViewModel(IObjectFactory objectFactory)
 {
     Navigation             = objectFactory.Create <INavigation>();
     AttachedToFrameCommand = new AsyncCommand(this, OnAttachedToViewCommand);
 }
 public CommandObjectReader(IObjectFactory objectFactory) : base(objectFactory)
 {
     UserDefinedValueDelegate = UserDefinedObjectReader.Read;
 }
 private static IGeometry BuildPoint(WktText wkt, IObjectFactory objectFactory)
 {
     return(BuildPoint(wkt.Token, wkt, objectFactory));
 }
 /// <summary>
 /// Creates a new instance of the <see cref="XmlObjectFactory"/> class,
 /// with the given resource, which must be parsable using DOM, and the
 /// given parent factory.
 /// </summary>
 /// <param name="resource">
 /// The XML resource to load object definitions from.
 /// </param>
 /// <param name="caseSensitive">Flag specifying whether to make this object factory case sensitive or not.</param>
 /// <param name="parentFactory">The parent object factory (may be <see langword="null"/>).</param>
 /// <exception cref="Spring.Objects.ObjectsException">
 /// In the case of loading or parsing errors.
 /// </exception>
 public XmlObjectFactory(
     IResource resource, bool caseSensitive, IObjectFactory parentFactory)
     : base(caseSensitive, parentFactory)
 {
     ObjectDefinitionReader.LoadObjectDefinitions(resource);
 }
示例#56
0
 public DependencyScope(IObjectFactory objectFactory)
 {
     ObjectFactory = objectFactory;
 }
 public GenericCollectionNodeDeserializer(IObjectFactory objectFactory)
 {
     _objectFactory = objectFactory;
 }
示例#58
0
        private void LoadApplicationDefinition(IAppValues appValues, IBindingService bindingService, IElementTypeMapping elementTypeMapping, IObjectFactory objectFactory)
        {
            try
            {
                XxElement element;
                using (var stream = GetType().Assembly.GetManifestResourceStream(GetType().Assembly.GetName().Name + ".App.xml"))
                {
                    var parser = objectFactory.Create <XxFileParser>(elementTypeMapping);
                    element = parser.Parse(stream);
                }

                var scopeBuilder = objectFactory.Create <IScopeBuilder>();

                scopeBuilder
                .WithInstance(elementTypeMapping).As <IElementTypeMapping>()
                .WithInstance(appValues).As <IAppValues>()
                .WithInstance(bindingService).As <IBindingService>();

                var services         = scopeBuilder.Build();
                var defObjectFactory = services.GetService <IObjectFactory>().Create <XxDefinitionObjectFactory>();

                defObjectFactory.CreateObject <ApplicationElement>(element);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                throw;
            }
        }
 public YamlSerializableNodeDeserializer(IObjectFactory objectFactory)
 {
     this.objectFactory = objectFactory;
 }
示例#60
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrgsDal"/> class.
 /// </summary>
 /// <param name="objectFactory">The object factory.</param>
 /// <param name="oraginzationRepository">The oraginzation repository.</param>
 public OrgsDal(IObjectFactory objectFactory, IOrganizationRepository oraginzationRepository)
 {
     _objectFactory          = objectFactory;
     _oraginzationRepository = oraginzationRepository;
 }