示例#1
0
文件: Program.cs 项目: leestott/Beats
        /// <summary>
        /// Main function of the application
        /// </summary>
        /// <param name="args"></param>
        /// <returns>
        /// -1 when an error occured during initialization
        /// result of the run function which is a loop returning 0 when ended
        /// </returns>
        public static int Main(string[] args)
        {
            var main = new MainClass();

            // Initialize application by reading configuration file
            if (!InitAppSettings(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "RaspberryPiGateway.exe")) return -1;
            // Initializa AMQP connection
            if (!InitAMQPConnection(false)) return -1;

            // start main routine
            return main.Run();
        }