本文整理汇总了C#中IWindsorContainer.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# IWindsorContainer.Dispose方法的具体用法?C# IWindsorContainer.Dispose怎么用?C# IWindsorContainer.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWindsorContainer
的用法示例。
在下文中一共展示了IWindsorContainer.Dispose方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
container = BotRunnerBootstrapper.Init();
var fineBot = new Bot();
var fineBotResponders = container.ResolveAll<IFineBotResponder>();
foreach (IFineBotResponder responder in fineBotResponders)
{
fineBot.Responders.Add(responder);
}
fineBot.RespondsTo("hi").IfBotIsMentioned().With("Stop resisting citizen!");
fineBot.CreateResponder(x => !x.BotHasResponded, rc => "My responses are limited, you must ask the right question...");
var task = fineBot.Connect(ConfigurationManager.AppSettings["BotKey"]);
Console.WriteLine(string.Format("{0}: Bot is runnning, type 'die' to make it die", DateTime.Now));
var secondCousinBot = new Bot();
var secondCousinResponders = container.ResolveAll<ISecondCousinResponder>();
foreach (ISecondCousinResponder responder in secondCousinResponders)
{
secondCousinBot.Responders.Add(responder);
}
var seconderTask = secondCousinBot.Connect(ConfigurationManager.AppSettings["SeconderBotKey"]);
Console.WriteLine(string.Format("{0}: Finebot's second cousin is also also running. Some say he can't die.", DateTime.Now));
while(Console.ReadLine() != "die")
{
}
container.Dispose();
}
示例2: all_registered_types
public void all_registered_types()
{
sut = WindsorContainerFactory.Create(false);
foreach (var handler in sut.Kernel.GetAssignableHandlers(typeof (object)))
Console.WriteLine("{0} {1}", handler.ComponentModel.Service, handler.ComponentModel.Implementation);
sut.Dispose();
}
示例3: resolve_with_Web_config
public void resolve_with_Web_config()
{
sut = WindsorContainerFactory.Create(true);
Assert.IsInstanceOf(typeof(WebCacheManager), sut.Resolve<ICacheManager>());
Assert.IsInstanceOf(typeof(TerminalTasks), sut.Resolve<ITerminalTasks>());
resolve_common_types();
sut.Dispose();
}
示例4: Create_WindsorContainer_from_WindsorContainerFactory
public void Create_WindsorContainer_from_WindsorContainerFactory()
{
sut = WindsorContainerFactory.Create(false);
foreach(var g in sut.Kernel.GraphNodes)
if(g.Dependers.Length == 0) {
Console.WriteLine();
WalkGraph(g, 0);
}
sut.Dispose();
}
示例5: resolve_with_Wpf_configuration
public void resolve_with_Wpf_configuration()
{
sut = WindsorContainerFactory.Create(false);
Assert.IsInstanceOf(typeof(WinCacheManager), sut.Resolve<ICacheManager>());
Assert.IsInstanceOf(typeof(EventWrappedTerminalTasks), sut.Resolve<ITerminalTasks>());
Assert.IsInstanceOf(typeof(EventWrappedTerminalTasks), sut.Resolve<ITerminalEvents>());
Assert.AreSame(sut.Resolve<ITerminalTasks>(), sut.Resolve<ITerminalEvents>());
Assert.IsInstanceOf(typeof(ScopedTerminalTasks), sut.Resolve<ITerminalTasks>(typeof(ScopedTerminalTasks).FullName));
Assert.IsInstanceOf(typeof(TerminalTasks), sut.Resolve<ITerminalTasks>(typeof(TerminalTasks).FullName));
resolve_common_types();
sut.Dispose();
}
示例6: Main
public static void Main(string[] args)
{
Console.WriteLine("Starting Main");
container=new WindsorContainer();
container.Install(
FromAssembly.This()
);
IMain app=container.Resolve<IMain>();
app.Begin();
app.AddSomeBlogs();
app.GetBlogByTitle("Blog 3");
app.AddSomeCommentsTo("Blog 3");
app.CountAllComments();
Console.Write("Completed.");
container.Dispose();
Console.ReadKey(true);
}
示例7: Main
static void Main(string[] args)
{
container = BotRunnerBootstrapper.Init();
Bot bot = new Bot();
foreach(IResponder responder in container.ResolveAll<IResponder>())
{
bot.Responders.Add(responder);
}
bot.RespondsTo("hi").IfBotIsMentioned().With("Stop resisting citizen!");
var task = bot.Connect(ConfigurationManager.AppSettings["SlackApiKey"]);
Console.WriteLine(String.Format("{0}: Bot is runnning, type 'die' to make it die", DateTime.Now));
while(Console.ReadLine() != "die")
{
}
container.Dispose();
}
示例8: Release
public static void Release(IWindsorContainer container)
{
container.Dispose();
}