示例#1
0
        static void Main(string[] args)
        {
            ConsoleUtil.ApplyCustomFont();
            ConsoleUtil.AllocConsole();
            ConsoleUtil.InstallCustomFontAndApply();
            Assembly a    = Assembly.GetExecutingAssembly();
            Icon     icon = new Icon(a.GetManifestResourceStream("WCell.Terminal.Resources.WCell.Terminal.ico"));

            ConsoleUtil.SetConsoleIcon(icon);
            AppUtil.AddApplicationExitHandler(ConsoleEventHandler);
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("({0}) <Terminal> Initializing...", DateTime.Now.ToString("hh:mm"));
            Version vrs = new Version(Application.ProductVersion);

            try
            {
                String ExePath    = Directory.GetCurrentDirectory();
                String SourcePath = Directory.GetParent(Directory.GetParent(ExePath).FullName).FullName;
                int    Revision   = WCell.Util.SvnUtil.GetVersionNumber(SourcePath);
                Console.Title = String.Format("WCell.Terminal v{0}.{1} rev {2}", vrs.Major, vrs.Minor, Revision);
            }
            catch (DirectoryNotFoundException)
            {
                Console.Title = String.Format("WCell.Terminal v{0}.{1}", vrs.Major, vrs.Minor);
            }
            catch (NullReferenceException)
            {
                Console.Title = String.Format("WCell.Terminal v{0}.{1}", vrs.Major, vrs.Minor);
            }
            Application.Run(new TerminalMain());
        }