本文整理汇总了C#中IKernel.AddComponent方法的典型用法代码示例。如果您正苦于以下问题:C# IKernel.AddComponent方法的具体用法?C# IKernel.AddComponent怎么用?C# IKernel.AddComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IKernel
的用法示例。
在下文中一共展示了IKernel.AddComponent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init()
{
kernel = new DefaultKernel();
kernel.AddComponent("compa", typeof(CompA));
kernel.AddComponent("compb", typeof(CompB));
deps = new Hashtable();
deps.Add("cc", new CompC(12));
deps.Add("myArgument", "ernst");
}
示例2: Init
public void Init()
{
kernel = new DefaultKernel();
kernel.AddComponent("compa", typeof(CompA));
kernel.AddComponent("compb", typeof(CompB));
deps = new Dictionary<string, object>();
deps.Add("cc", new CompC(12));
deps.Add("myArgument", "ernst");
}
示例3: Init
public void Init(IKernel kernel, IConfiguration facilityConfig)
{
kernel.AddComponent( "transactionmanager",
typeof(ITransactionManager), typeof(DefaultTransactionManager) );
kernel.AddComponent( "transaction.interceptor",
typeof(TransactionInterceptor) );
kernel.AddComponent( "transaction.configholder", typeof(TransactionConfigHolder) );
_transactionConfigHolder =
kernel[ typeof(TransactionConfigHolder) ] as TransactionConfigHolder;
kernel.ComponentModelCreated += new ComponentModelDelegate(OnModelCreated);
}
示例4: Init
public void Init(IKernel kernel, IConfiguration config)
{
kernel.AddComponent("managed.dispatcher.interceptor", typeof());
_connector = MConnectorFactory.CreateConnector( "provider:http:binary:test.rem", null );
kernel.ComponentModelBuilder.AddContributor( new Client.ManagementExtensionModelClientInspector() );
}
示例5: CreateObjects
public void CreateObjects()
{
_kernel = new DefaultKernel();
foreach (Type type in _classes)
{
_kernel.AddComponent(type.ToString(), type);
}
}
示例6: CreateObjects
public void CreateObjects()
{
_kernel = new DefaultKernel();
foreach (Type type in _classes)
{
_kernel.AddComponent(type.ToString(), type);
log.DebugFormat("Creating instance of type <{0}>.", type);
}
}
示例7: Multithreaded
public void Multithreaded()
{
_kernel = new DefaultKernel();
_kernel.AddComponent("a", typeof(PoolableComponent1));
const int threadCount = 15;
Thread[] threads = new Thread[threadCount];
for(int i = 0; i < threadCount; i++)
{
threads[i] = new Thread(new ThreadStart(ExecuteMethodUntilSignal));
threads[i].Start();
}
_startEvent.Set();
Thread.CurrentThread.Join(3 * 1000);
_stopEvent.Set();
}