示例#1
0
 public override void Execute()
 {
     Console.Clear();
     Console.WriteLine("Press any key to shutdown...");
     Console.ReadKey(true);
     userACPI.Shutdown();
 }
示例#2
0
 public override void Execute()
 {
     Console.Clear();
     Console.WriteLine("Press any key to reboot...");
     Console.ReadKey(true);
     userACPI.Reboot();
 }
示例#3
0
 public override void Execute()
 {
     Console.Clear();
     Console.ForegroundColor = ConsoleColor.White;
     Console.BackgroundColor = ConsoleColor.Black;
     menu.recovery           = true;
 }
示例#4
0
 public static void Run()
 {
     Console.Clear();
     menu.Reset();
     Categories.CategoryConfig();
     Entries.EntryConfig();
     menu.Show();
 }
示例#5
0
 public override void Execute()
 {
     Console.Clear();
     Console.WriteLine("Apollo Test Entry");
     Console.ReadKey(true);
     Console.Clear();
     // Place the code that should be executed here
 }
示例#6
0
        public override void Execute()
        {
            Console.Clear();
            Console.WriteLine("Hello World!");
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey(true);

            // Place the code that should be executed here
        }
 public static void RollDown(uint mspause)
 {
     for (int i = 0; i < 26; i++)
     {
         for (int j = 0; j < 81; j++)
         {
             AConsole.Write(" ");
             AIC.Core.PIT.SleepMilliseconds(mspause);
         }
     }
     AConsole.Clear();
 }
示例#8
0
        /// <summary>
        /// Fills the Console Background with a color
        /// </summary>
        /// <param name="color"></param>
        public static void Fill(ConsoleColor color)
        {
            AConsole.Clear();
            ConsoleColor backup = AConsole.BackgroundColor;

            AConsole.BackgroundColor = color;
            for (int i = 0; i < (80 * 25); i++)
            {
                AConsole.Write(" ");
            }
            AConsole.BackgroundColor = backup;
            AConsole.CursorTop       = 0;
        }
示例#9
0
 /// <summary>
 /// Initiates a Bluescreen.
 /// </summary>
 /// <param name="error">Error title or exception name</param>
 /// <param name="description">Error description</param>
 /// <param name="critical">Critical error?</param>
 public static void Init(
     string error       = "Something went wrong!",
     string description = "Unknown exception",
     bool critical      = false)
 {
     DrawOOPS();
     if (description.Length + 33 < System.Console.WindowHeight)
     {
         System.Console.CursorTop = 2; System.Console.CursorLeft = 33;
         ConsoleColor errcolor = ConsoleColor.White;
         if (critical)
         {
             errcolor = ConsoleColor.Red;
         }
         AConsole.WriteLineEx(error, errcolor, ConsoleColor.Blue);
         AConsole.CursorTop = 4; AConsole.CursorLeft = 70;
         AConsole.WriteLineEx(description, ConsoleColor.White, ConsoleColor.Blue);
     }
     else
     {
         AConsole.CursorTop = 12; AConsole.CursorLeft = 2;
         ConsoleColor errcolor = ConsoleColor.White;
         if (critical)
         {
             errcolor = ConsoleColor.Red;
         }
         AConsole.WriteLineEx(error, errcolor, ConsoleColor.Blue);
         AConsole.CursorTop = 14; AConsole.CursorLeft = 2;
         AConsole.WriteLineEx(description, ConsoleColor.White, ConsoleColor.Blue);
     }
     if (!critical)
     {
         AConsole.CursorTop = AConsole.WindowHeight - 1;
         AConsole.WriteEx("Press the [Enter]-key to resume", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.ReadLine();
         AConsole.Clear();
     }
     else
     {
         AConsole.CursorTop = AConsole.WindowHeight - 4;
         AConsole.WriteLineEx("Press the [Enter]-key to shutdown", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.WriteLineEx("If it doesn't work, press the RESET-button on your computer.", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.ReadLine();
         ACPI.Shutdown();
     }
 }
示例#10
0
 public override void Execute()
 {
     Console.Clear();
     Console.WriteLine("Press any key to start a test Stop Error");
     Console.ReadKey(true);
     try
     {
         System.IO.File.WriteAllText("WHAT", "LKJHSDLKFJHSD£^$&*£$");
     }
     catch (Exception ex)
     {
         AIC_Framework.Bluescreen.Init(ex, true);
         // Place the code that should be executed here
     }
 }
示例#11
0
        /// <summary>
        /// Kernel Panic
        /// </summary>
        public static void Panic()
        {
            AConsole.Clear();
            AConsole.Fill(ConsoleColor.Red);
            AConsole.CursorTop = 2;
            AConsole.WriteLineEx("KERNEL PANIC", ConsoleColor.White, ConsoleColor.Red, true);
            AConsole.WriteLine("\n");
            string message = "CRITICAL KERNEL EXCEPTION\nPLEASE CONTACT YOUR SOFTWARE MANUFACTURER";

            AConsole.WriteLineEx(message, ConsoleColor.White, ConsoleColor.Red, true);
            // Enter an infinite loop
            while (true)
            {
            }
        }
示例#12
0
 public static void Init(Exception ex, bool critical = false)
 {
     DrawOOPS();
     if (ex.Message.Length + 33 < AConsole.WindowHeight)
     {
         AConsole.CursorTop = 2; AConsole.CursorLeft = 33;
         ConsoleColor errcolor = ConsoleColor.White;
         if (critical)
         {
             errcolor = ConsoleColor.Red;
         }
         //AConsole.WriteLineEx(ex.Source, errcolor, ConsoleColor.Blue);
         AConsole.CursorTop = 3; AConsole.CursorLeft = 70;
         AConsole.WriteLineEx(ex.Message, ConsoleColor.White, ConsoleColor.Blue);
     }
     else
     {
         AConsole.CursorTop = 12; AConsole.CursorLeft = 2;
         ConsoleColor errcolor = ConsoleColor.White;
         if (critical)
         {
             errcolor = ConsoleColor.Red;
         }
         //AConsole.WriteLineEx(ex.Source, errcolor, ConsoleColor.Blue);
         AConsole.CursorTop = 13; AConsole.CursorLeft = 2;
         AConsole.WriteLineEx(ex.Message, ConsoleColor.White, ConsoleColor.Blue);
     }
     if (!critical)
     {
         AConsole.CursorTop = AConsole.WindowHeight - 3;
         AConsole.WriteEx("Press the [Enter]-key to resume", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.ReadLine();
         AConsole.Clear();
     }
     else
     {
         AConsole.CursorTop = AConsole.WindowHeight - 4;
         AConsole.WriteEx("Press the [Enter]-key to shutdown", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.WriteEx("If it doesn't work, press the RESET-button on your computer.", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.ReadLine();
         ACPI.Shutdown();
     }
 }
示例#13
0
 private static void DrawOOPS()
 {
     AConsole.Fill(ConsoleColor.Blue);
     string[] arrOOPS = new string[] {
         "======  ======  =====  =====  =",
         "=    =  =    =  =   =  =      =",
         "=    =  =    =  =====  =====  =",
         "=    =  =    =  =          =   ",
         "======  ======  =      =====  ="
     };
     AConsole.CursorTop = 2;
     foreach (string str in arrOOPS)
     {
         AConsole.CursorLeft = 2;
         AConsole.WriteLineEx(str, ConsoleColor.White, ConsoleColor.Blue);
     }
 }
示例#14
0
            /// <summary>
            /// INFO: MaxValue is 100 and MinValue is 0.
            /// </summary>
            /// <param name="value"></param>
            public void Draw()
            {
                int ct = AConsole.CursorTop;
                int cl = AConsole.CursorLeft;

                AConsole.WriteLine();
                string buffer = "[                                                  ] ";

                AConsole.Write(buffer);
                AConsole.CursorLeft = cl + 1;
                if (flicker)
                {
                    for (int i = 0; i < this.value / 2; i++)
                    {
                        if (this.value / 2 <= 50)
                        {
                            AConsole.Write("=");
                        }
                    }
                }
                else
                {
                    string __buffer = "";
                    for (int i = 0; i < this.value / 2; i++)
                    {
                        if (this.value / 2 <= 50)
                        {
                            __buffer += "=";
                        }
                    }
                    AConsole.Write(__buffer);
                }
                AConsole.CursorLeft = cl + 54;
                AConsole.Write(this.value.ToString() + "%");
                AConsole.CursorTop  = ct;
                AConsole.CursorLeft = cl;
            }
示例#15
0
 private static void ShowEntryMenu()
 {
     for (int i = 10 - (cat[itemcat].entries.Count / 2); i < 11 + cat.Count; i++)
     {
         string buffer = "";
         AConsole.CursorTop = i;
         for (int j = 10; j <= 70; j++)
         {
             buffer += " ";
         }
         AConsole.CursorLeft = 10;
         AConsole.WriteEx(buffer, background, background);
     }
     AConsole.CursorTop = 11 - (cat[itemcat].entries.Count / 2);
     for (int i = 0; i < cat[itemcat].entries.Count; i++)
     {
         if (i == item)
         {
             WriteEx(cat[itemcat].entries[i].text, highlighted, background, true);
             CursorLeft = 69;
             WriteLineEx(">", arrow, background);
         }
         else
         {
             WriteLineEx(cat[itemcat].entries[i].text, normal, background, true);
         }
     }
     while (true)
     {
         ConsoleKey key = AConsole.ReadKey().Key;
         if (key == ConsoleKey.UpArrow)
         {
             if (item > 0)
             {
                 item--;
             }
             else
             {
                 item = cat[itemcat].entries.Count - 1;
             }
             break;
         }
         else if (key == ConsoleKey.DownArrow)
         {
             if (item < cat[itemcat].entries.Count - 1)
             {
                 item++;
             }
             else
             {
                 item = 0;
             }
             break;
         }
         else if (key == ConsoleKey.Enter || key == ConsoleKey.RightArrow)
         {
             cat[itemcat].entries[item].Execute();
             break;
         }
     }
 }
示例#16
0
 protected override void BeforeRun()
 {
     Bootscreen.Show("Welcome to the AIC Framework test project!", Bootscreen.Effect.Matrix, ConsoleColor.Green, 5);
     Console.Clear();
     menu.Reset();
 }
示例#17
0
        public static void Show(string OSname, Effect efx, ConsoleColor color, int ms_sleep)
        {
            if (ms_sleep % 2 == 1)
            {
                ms_sleep++;
            }
            switch (efx)
            {
            case Effect.SlideFromLeft:

                for (int i = 0; i < ((AConsole.WindowWidth / 2) - (OSname.Length / 2)); i++)
                {
                    AConsole.Clear();
                    AConsole.CursorLeft = i;
                    string fill = "";
                    for (int x = 0; x < i; x++)
                    {
                        fill += " ";
                    }
                    AConsole.Write(fill);
                    AConsole.Write(OSname, color, false, true);
                    AIC.Core.PIT.SleepMilliseconds((uint)ms_sleep);
                }
                break;

            case Effect.SlideFromRight:

                for (int i = (AConsole.WindowWidth - OSname.Length);
                     i > ((AConsole.WindowWidth / 2) - (OSname.Length / 2)); i--)
                {
                    AConsole.Clear();
                    AConsole.CursorLeft = i;
                    AConsole.Write(OSname, color, false, true);
                    AIC.Core.PIT.SleepMilliseconds((uint)ms_sleep);
                }
                break;

            case Effect.SlideFromTop:

                for (int i = 0; i < (AConsole.WindowHeight / 2); i++)
                {
                    AConsole.Clear();
                    AConsole.CursorTop = i;
                    AConsole.WriteLine(OSname, color, true, false);
                    AIC.Core.PIT.SleepMilliseconds((uint)ms_sleep);
                }
                break;

            case Effect.SlideFromBottom:

                for (int i = (AConsole.WindowHeight - 1); i > (AConsole.WindowHeight / 2); i--)
                {
                    AConsole.Clear();
                    AConsole.CursorTop = i;
                    AConsole.WriteLine(OSname, color, true, false);
                    AIC.Core.PIT.SleepMilliseconds((uint)ms_sleep);
                }
                break;

            case Effect.Typewriter:

                AConsole.CursorLeft = ((AConsole.WindowWidth / 2) - (OSname.Length / 2));
                foreach (char chr in OSname)
                {
                    AConsole.Write(chr.ToString(), color, false, true);
                    AIC.Core.PIT.SleepMilliseconds((uint)ms_sleep);
                }
                break;

            case Effect.Matrix:

                int sec1 = AIC.Hardware.RTC.Now.Second;
                int sec2 = sec1;
                do
                {
                    sec2 = AIC.Hardware.RTC.Now.Second;
                } while (sec1 == sec2);
                int sec3;
                if (sec2 <= 56)
                {
                    sec3 = sec2 + 3;
                }
                else if (sec2 == 57)
                {
                    sec3 = 1;
                }
                else if (sec2 == 58)
                {
                    sec3 = 2;
                }
                else if (sec2 == 59)
                {
                    sec3 = 3;
                }
                else
                {
                    sec3 = 3;
                }
                int tmr  = 0;
                int tmrx = 0;
                for (int i = 0; i < 10; i++)
                {
                    for (int ih = 0; ih < AConsole.WindowHeight; ih++)
                    {
                        for (int iw = 0; iw < AConsole.WindowWidth; iw++)
                        {
                            if (tmr == 11)
                            {
                                tmr = 0;
                            }
                            if (tmrx == 4)
                            {
                                tmrx = 0;
                            }
                            tmr++;
                            if (tmr == 0)
                            {
                                AConsole.Write("#", ConsoleColor.Magenta);
                            }
                            if (tmrx == 3)
                            {
                                AConsole.Write("*", ConsoleColor.Green);
                            }
                            if (tmr == 2)
                            {
                                AConsole.Write(";", ConsoleColor.Red); ++tmrx;
                            }
                            if (tmrx == 1)
                            {
                                AConsole.Write("+", ConsoleColor.Yellow);
                            }
                            if (tmr == 4)
                            {
                                AConsole.Write("~", ConsoleColor.Blue); ++tmrx;
                            }
                            if (tmrx == 2)
                            {
                                AConsole.Write("&", ConsoleColor.Cyan);
                            }
                            AConsole.Write(OSname, ConsoleColor.White, true, true);
                        }
                    }
                }
                break;
            }
        }
示例#18
0
 public static void WriteLine(string text)
 {
     AConsole.WriteLine("[!] ERROR: " + text.ToUpper(), ConsoleColor.Red);
 }
示例#19
0
 public override void Execute()
 {
     Console.WriteLine("getRAM");
 }