示例#1
0
        /// <summary>
        /// Instructs REstate to use a custom container for all components.
        /// Defaults will be registered into the specified container.
        /// </summary>
        /// <param name="host">The host to modify</param>
        /// <param name="container">The container to use.</param>
        private static bool TryUseContainer(REstateHost host, IComponentContainer container)
        {
            if (host.HostConfiguration == null)
            {
                lock (host.ConfigurationSyncRoot)
                {
                    if (host.HostConfiguration == null)
                    {
                        var configuration = new HostConfiguration(container);

                        configuration.RegisterDefaults();

                        host.HostConfiguration = configuration;

                        return(true);
                    }
                }
            }

            return(false);
        }
示例#2
0
文件: Agent.cs 项目: psibr/REstate
 public Agent(HostConfiguration hostConfiguration)
 {
     Configuration = hostConfiguration;
 }