예제 #1
0
파일: Program.cs 프로젝트: ScottNZ/CSBot
		static void Main(string[] args)
		{
			var setupFilename = args.Length > 0 ? args[0] : "CSBot.xml";

			IrcClientSetup setup;
			using (var streamReader = new StreamReader(setupFilename))
				setup = IrcClientSetup.Deserialize(streamReader);
			
			var client = new IrcClient(setup);

			var moduleManager = new ModuleManager(client);
			moduleManager.LoadAllModules();

			client.Connect();
		}
예제 #2
0
        // stay on the caller's appdomain, may go away when i fix ModuleManager to properly resolve things in the main appdomain

        public static T Get <T>(this ModuleManager moduleManager) where T : CSBotModule
        {
            return(moduleManager.LoadedModules.Values.Select(m => m.Module as T).FirstOrDefault(m => m != null));
        }