Example #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            bool RunAsService = GetBoolSetting("RunAsService", true);
            if (RunAsService)
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                new Service()
                };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                SuperFriendBot bot = new SuperFriendBot();
                bot.Start();

                AllocConsole();
                string result = Console.ReadLine();
                while(result != "q")
                {
                    result = Console.ReadLine();
                }
            }
        }
Example #2
0
 public Service()
 {
     InitializeComponent();
     _bot = new SuperFriendBot();
 }