Example #1
0
        /// <summary>
        /// Get the entries of the calling class
        /// </summary>
        /// <param name="category"></param>
        public static void GetEntries(string category)
        {
            if (!initialized)
            {
                init();
            }
            // Save current console state
            AB.PushContents();
            // Write the entries
            int  max      = Console.WindowHeight - 4;
            int  found    = 0;
            bool finished = false;

            while (!finished)
            {
                if (found < cc.Count)
                {
                    for (int i = found; i < cc.Count; i++)
                    {
                        if (category == category[i].ToString())
                        {
                            AConsole.WriteLine(ds[i].ToString());
                        }
                    }
                }
            }
            AConsole.WriteLine("Press any key to continue...");
            AConsole.ReadKey(true);
            AB.PopContents();
        }
Example #2
0
 private static void DrawScreen()
 {
     AConsole.Fill(ConsoleColor.Blue);
     Console.CursorTop = 0;
     AConsole.WriteLineEx(" Cocoapad Viewer ", ConsoleColor.White, ConsoleColor.Gray, true, false);
     Console.BackgroundColor = ConsoleColor.Blue;
     Console.CursorTop       = 3;
 }
Example #3
0
 /// <summary>
 /// Draws the screen.
 /// </summary>
 private static void DrawScreen()
 {
     AConsole.Fill(ConsoleColor.Blue);
     Console.CursorTop       = 0;
     Console.BackgroundColor = ConsoleColor.Gray;
     Console.WriteLine(" Medli Application IDE ");
     Console.BackgroundColor = ConsoleColor.Blue;
     Console.CursorTop       = 3;
 }
Example #4
0
 private static void DrawScreen()
 {
     AConsole.Fill(ConsoleColor.Blue);
     Console.CursorTop       = 0;
     Console.BackgroundColor = ConsoleColor.Gray;
     Console.WriteLine(" Cocoapad Viewer ");
     Console.BackgroundColor = ConsoleColor.Blue;
     Console.CursorTop       = 3;
 }
Example #5
0
        /// <summary>
        /// Main method for the Cocoapad edit
        /// Originally from Chocolate OS (pre-Medli) but won't rename this application
        /// </summary>
        /// <param name="file"></param>
        public static void Run(string file)
        {
            DrawScreen();
            Console.WriteLine("Cocoapad is a multi line text editor you can use to create many files.");
            Console.WriteLine("Once you have finished you can type '$SAVE' to save your file or '$END'");
            Console.WriteLine("to close without saving. '$RESET' can be used to start the file again from\nfresh, but use with caution!");
            Console.WriteLine("\nFilenames can currently only have 3 letter extensions but this will be fixed in the future.");
            //MEnvironment.PressAnyKey("Press any key to begin!");
            Console.WriteLine("Press any key to begin!");
            Console.ReadKey(true);
            DrawScreen();
            text = "";
            string line;
            var    num = 1;

            while (running == true)
            {
                Console.Write(num + ": ");
                num  = num + 1;
                line = Console.ReadLine();
                if (line == "$END")
                {
                    Console.WriteLine("Would you like to save first?");
                    string notsaved = Console.ReadLine();
                    if (notsaved == "y")
                    {
                        File.Create(Paths.CurrentDirectory + @"\" + file);
                        File.WriteAllText(Paths.CurrentDirectory + @"\" + file, text);
                        running = false;
                    }
                    else if (notsaved == "n")
                    {
                        running = false;
                    }
                }
                if (line == "$RESET")
                {
                    text = "";
                    DrawScreen();
                }
                if (line == "$SAVE")
                {
                    File.Create(Paths.CurrentDirectory + @"\" + file);
                    File.WriteAllText(Paths.CurrentDirectory + @"\" + file, text);
                    running = false;
                }
                text = text + (Environment.NewLine + line);
                if (Console.CursorTop == 24)
                {
                    DrawScreen();
                }
            }
            AConsole.Fill(ConsoleColor.Black);
        }
Example #6
0
        public override void HandleMessage(INetPacketStream packet)
        {
            base.HandleMessage(packet);

            var data = packet.Read <byte>(packet.Size);

            Console.WriteLine("Client -> Server | Size: {0}", data.Length);
            AConsole.WriteHexView(data);
            Console.WriteLine();

            using (var p = new PhotonPacket())
            {
                p.Write(data, 0, data.Length);
                AppContext.Instance.ProxyClient.Send(p);
            }
        }
Example #7
0
 /// <summary>
 /// Starts the INIT method, creating filesystem, registering the filesystem
 /// </summary>
 public static void Start()
 {
     VFSManager.RegisterVFS(fs);
     Console.WriteLine("Initializing filesystem...");
     fs.Initialize();
     Console.Clear();
     AConsole.WriteLineEx("    Welcome to Apollo OS    ", ConsoleColor.White, ConsoleColor.Black, true, false);
     AConsole.WriteLineEx("Press any key to continue...", ConsoleColor.White, ConsoleColor.Black, true, false);
     AConsole.ReadKey(true);
     if (IntegrityCheck() == false)
     {
         Console.Clear();
         Console.WriteLine("Filesystem integrity checks completed!");
         Console.WriteLine("Not all directories were present however, so they have been recreated.");
         Console.WriteLine("Data loss is to be expected.");
         Environment_variables.PressAnyKey();
         Console.Clear();
     }
     else
     {
         Console.Clear();
         Console.WriteLine("Filesystem integrity checks completed!");
         Console.WriteLine("All filesystem checks passed successfully, but be sure to check files in case.");
         Environment_variables.PressAnyKey();
         Console.Clear();
     }
     UserInit();
     if (!File.Exists(usr_vars.varsfile))
     {
         File.Create(KernelVariables.bindir + "vars.sys").Dispose();
     }
     else
     {
         usr_vars.ReadVars();
     }
     Console.WriteLine("SysGuard Checks proceeded.");
     Environment_variables.PressAnyKey("Press any key to continue boot...");
     Console.Clear();
 }
Example #8
0
        /// <summary>
        /// Main method for the Cocoapad Development Environment
        /// Originally from Chocolate OS (proto-Medli)
        /// </summary>
        /// <param name="file"></param>
        public static void Run(string file)
        {
            DrawScreen();
            Console.WriteLine("The Medli Application IDE is an Integrated Development Environment");
            Console.WriteLine("users can use to develop applications for Medli.");
            Console.WriteLine("The same basic commands are used as Cocoapad Editor, but with a few");
            Console.WriteLine("extra commands to allow for the creation and running of apps.\n");
            Console.WriteLine("IDE commands:");
            Console.WriteLine("$END - Exits the IDE without saving");
            Console.WriteLine("$SAVE - Saves the current file");
            Console.WriteLine("$RESET - Resets the IDE and file to start again from fresh");
            Console.WriteLine("$RUN - Saves the file and executes it in the Medli Application Launcher");
            Extensions.PressAnyKey("Press any key to begin!");
            DrawScreen();
            text = "";
            AppInfo();
            string line;
            var    num = 4;

            while (running == true)
            {
                Console.Write(num + ": ");
                num  = num + 1;
                line = Console.ReadLine();
                if (line == "$END")
                {
                    if (text != File.ReadAllText(file))
                    {
                        Console.WriteLine("Would you like to save first?");
                        string notsaved = Console.ReadLine();
                        if (notsaved == "y")
                        {
                            File.Create(Paths.CurrentDirectory + @"\" + file);
                            File.WriteAllText(Paths.CurrentDirectory + @"\" + file, text);
                            running = false;
                        }
                        else if (notsaved == "n")
                        {
                            running = false;
                        }
                    }
                }
                if (line == "$RESET")
                {
                    text = "";
                    AppInfo();
                }
                if (line == "$SAVE")
                {
                    if (!text.EndsWith("EOF"))
                    {
                        text += "EOF";
                    }
                    File.WriteAllText(Paths.CurrentDirectory + @"\" + file, text);
                    running = false;
                    Extensions.PressAnyKey();
                }
                if (line == "$RUN")
                {
                    if (!text.EndsWith("EOF"))
                    {
                        text += "EOF";
                    }
                    File.WriteAllText(Paths.CurrentDirectory + @"\" + file, text);
                    running = false;
                    Console.Clear();
                    AppLauncher.PreExecute(file);
                    Extensions.PressAnyKey();
                }
                text += (Environment.NewLine + line);
                if (Console.CursorTop == 24)
                {
                    DrawScreen();
                }
            }
            AConsole.Fill(ConsoleColor.Black);
        }
 /// <summary>
 /// Initializes the installer service and allows the user to choose a machine name
 /// Sets the machine name as a variable and writes it to the disk
 /// </summary>
 /// <returns></returns>
 public static bool Init()
 {
     if (FSService.Active == false)
     {
         Kernel.username = "******";
         Kernel.pcname   = "testing";
         mDebugger.Send("Installer - Skipping Installer due to live filesystem.");
         return(false);
     }
     else if (Kernel.IsLive == true)
     {
         Kernel.username = "******";
         Kernel.pcname   = "testing";
         mDebugger.Send("Installer - Skipping Installer due to live filesystem.");
         return(false);
     }
     else if (FSService.Active == true && Kernel.IsLive == false)
     {
         if (File.Exists(Kernel.pcinfo))
         {
             try
             {
                 string[] pcnames = File.ReadAllLines(Kernel.pcinfo);
                 Kernel.pcname = pcnames[0];
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.Message);
             }
         }
         Console.WriteLine("Does usrinfo exist?");
         Console.WriteLine(File.Exists(Kernel.usrinfo));
         KernelExtensions.PressAnyKey();
         if (File.Exists(Kernel.usrinfo))
         {
             Console.Clear();
             try
             {
                 Accounts.UserLogin();
                 AConsole.Fill(ConsoleColor.Blue);
                 Console.ForegroundColor = ConsoleColor.White;
                 Console.WriteLine("Welcome back, " + Kernel.username + @"!");
                 KernelExtensions.PressAnyKey();
             }
             catch (Exception ex)
             {
                 AConsole.Error.WriteLine("Medli encountered an exception during the pre-initialization stage.\nError: " + ex.Message);
                 KernelExtensions.PressAnyKey();
             }
         }
         else
         {
             Console.Clear();
             Installer.ScreenSetup();
             Installer.WriteLine("Medli was unable to find any info regarding your PC.");
             Installer.WriteLine("The Medli installer will now run.");
             ServiceLogger = new LoggingService(Paths.SystemLogs + @"\ins.log");
             ServiceLogger.Record("Installer Service logger initialized.");
             ServiceLogger.Record("Installer Service running on " + Paths.Root);
             mDebugger.Send("Running setup...");
             Installer.PressAnyKey();
             Console.Clear();
             Active = true;
             Installer.Main();
         }
         Active = false;
         return(true);
     }
     else
     {
         return(false);
     }
 }