Pickaxe.Program.Main C# (CSharp) Method

Main() public static method

public static Main ( string args ) : void
args string
return void
        public static void Main(string[] args)
        {
            ConsoleAppender.PlatConsole.Init();
            PrintHeader();

            string location = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string log4netPath = Path.Combine(Path.GetDirectoryName(location), "Log4net.config");
            log4net.Config.XmlConfigurator.Configure(new FileInfo(log4netPath));

            if (args.Length == 0) //interactive prompt
                Interactive();
            else
            {
                //run the file
                var sources = new List<string>();

                if (!File.Exists(args[0]))
                {
                    ConsoleAppender.PlatConsole.Print(string.Format("File {0} not found.", args[0]));
                    return;
                }

                //read the files
                var reader = new StreamReader(args[0]);
                sources.Add(reader.ReadToEnd());

                Thread thread = new Thread(() => Compile(sources.ToArray(), args.Skip(1).ToArray()));
                thread.Start();
                thread.Join();
            }
        }