protected override void BeforeRun() { try { Console.BackgroundColor = ConsoleColor.Blue; Console.Clear(); Console.WriteLine("Loading Built In Apps"); BuiltInApps = new BuiltInApps(); signInSheet = new SignInSheet(); ticTacToe = new TicTacToe(); essayReviser = new EssayReviser(); pong = new Pong(); makeArt = new MakeArt(); Console.WriteLine("Loading Thread Manager"); threadManager = new ThreadManager(); Console.WriteLine("Loading NoteBook"); var fs = new Sys.FileSystem.CosmosVFS(); Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs); saveFiles = new SaveFiles(); noteBook = new NoteBook(); Console.WriteLine("Loading Knowldege"); knowledge = new Knowledge(); Console.WriteLine("Loading Graphical Effexts"); gfx = new GraphicFx(); Console.WriteLine("Constellation OS booted succesfully"); systemLogger = new SystemLogger(); systemLogger.Log("Constellation booted up"); } catch (Exception e) { Console.WriteLine("Err 0; BOOTFALIURE\nMSG: " + e.Message); Console.ReadKey(); Sys.Power.Shutdown(); } }
public void SaveLog(NoteBook noteBook) { Console.WriteLine("System Logger"); Console.WriteLine("Saving as a new page..."); noteBook.book.Add(log); Console.WriteLine("Saved"); }
public void LoadNotebook(NoteBook book) { Tools tools = new Tools(); book.book = new List <List <string> >(); Console.WriteLine("Loading Count File"); int lenght = int.Parse(File.ReadAllText(@filesystem + "notebookcount.dat")); for (int i = 1; i <= lenght; i++) { Console.WriteLine("Loading page " + i.ToString()); try { book.book.Add(tools.ArrayToList(File.ReadAllLines(@"0:\page" + i.ToString()))); } catch { } } Console.WriteLine("Done"); }
public void SaveNotebook(NoteBook book) { Tools tools = new Tools(); int pagenum = 1; Console.WriteLine("Making Count File"); File.WriteAllText(@"0:\notebookcount.dat", book.book.Count.ToString()); foreach (List <string> page in book.book) { Console.WriteLine("Saving page " + pagenum.ToString()); try { File.WriteAllLines(filesystem + "page" + pagenum.ToString(), tools.ListToArray(page)); } catch { } pagenum++; } Console.WriteLine("Done"); }
public void Main(NoteBook noteBook) { Console.Clear(); Console.WriteLine("Make Art\n(C)Michael Wang\nWrite 'exit' to exit and 'help' for help."); while (true) { Console.Write("home/makeart>"); string input = Console.ReadLine(); if (input == "help") { Console.WriteLine("GETPX Gets the pixel at the given coordinates."); Console.WriteLine("EDITPX Edits the pixel at the given coordinates."); Console.WriteLine(); Console.WriteLine("PCIMG Loads an image of a desktop."); Console.WriteLine("BOAT Loads an image of a boat."); Console.WriteLine("FEILD Loads an image of a feild."); Console.WriteLine(); Console.WriteLine("SAVE Saves the image to your notebook"); Console.WriteLine("SHOWIMG Displays the image."); Console.WriteLine("PICCLEAR Clears the picture."); Console.WriteLine("EXIT Exits the app."); Console.WriteLine("HELP Gets Help."); Console.WriteLine("CLEAR Clears the console."); Console.WriteLine("CLS Clears the console."); } else if (input == "cls" || input == "clear") { Console.Clear(); } else if (input == "exit") { return; } else if (input == "piccls" || input == "picclear") { picture = clear; } else if (input == "save") { Tools tools = new Tools(); noteBook.book.Add(tools.ArrayToList(picture)); Console.WriteLine("Saved to the last pages last line"); } else if (input == "showimg") { Draw(); } else if (input == "feild") { picture = field; } else if (input == "boat") { picture = boat; } else if (input == "pcimg") { picture = computer; } else if (input.StartsWith("editpx ")) { try { string[] args = input.TrimStart("editpx ".ToCharArray()).Split(' '); int x = int.Parse(args[0]); int y = int.Parse(args[1]); char[] row = picture[y - 1].ToCharArray(); row[x - 1] = args[2][0]; picture[y - 1] = new string(row); Console.WriteLine("Changes applied"); } catch { Console.WriteLine("Err 2"); } } else if (input.StartsWith("getpx ")) { try { string[] args = input.TrimStart("getpx ".ToCharArray()).Split(' '); int x = int.Parse(args[0]); int y = int.Parse(args[1]); Console.WriteLine("Value: " + picture[y - 1][x - 1]); } catch { Console.WriteLine("Err 2"); } } } }
public void Start(NoteBook book) { while (true) { Console.Clear(); Console.WriteLine("Sign In Sheet Application\nConsetellation OS (C) Michael Wang\nWrite 'help' for help\n"); Console.Write("name>"); string inp = Console.ReadLine(); if (inp == "exit") { return; } if (inp == "help") { Console.WriteLine("Just type in your name, and well do the rest for you. Note that all names are case sensitive, such as 'Michael Wang' won't match 'michael wang'."); Console.WriteLine("\nPress any key to continue"); Console.ReadKey(); } else if (inp == "peek") { Console.Clear(); Console.WriteLine("Sign In Sheet"); foreach (string person in sheet) { string[] args = person.Split(','); if (args.Length == 2) { Console.WriteLine("Name: " + args[0] + ".\nSigned In: " + args[1] + ". Signed Out: N/A."); } else if (args.Length == 3) { Console.WriteLine("Name: " + args[0] + ".\nSigned In: " + args[1] + ". Signed Out: " + args[2]); } else { Console.WriteLine("CORRUPT POSITION; RAW: " + person); } } Console.WriteLine("\nPress any key to continue"); Console.ReadKey(); } else if (inp == "threadmanager") { threadManager.OpenThreadManager("Sign In Sheet", "signinsheet", "This application helps easy sign in and easy sign outs."); } else if (inp == "save") { book.book.Add(sheet); } else if (inp == "clear") { sheet = new List <string>(); } else { if (!Registered(inp)) { sheet.Insert(0, inp + "," + DateTime.Now); Console.WriteLine("Thank you for signing in"); } else { if (SignedIn(inp)) { sheet[GetListIndex(inp)] += "," + DateTime.Now; Console.WriteLine("Good Bye. Thank you for signing out."); } else { sheet.Insert(0, inp + "," + DateTime.Now); Console.WriteLine("Welcome back, " + inp + ". Sign in and sign out procedures are still the same."); } } Console.WriteLine("\nPress any key to continue."); Console.ReadKey(); } } }
public void Start(ref NoteBook book) { Console.WriteLine("Essay Reviser\n(C) Michael Wang"); Console.Write("Page Number>"); try { int pagenum = int.Parse(Console.ReadLine()); while (true) { Console.Write("essayrev>"); string inp = Console.ReadLine(); if (inp == "help") { Console.WriteLine("HELP Gets help."); Console.WriteLine("CLS Clears the console."); Console.WriteLine("CLEAR Clears the console."); Console.WriteLine("VOCAB Makes better use of vocabulary."); Console.WriteLine("SPELL Fixes basic common spelling errors."); Console.WriteLine("GRAMMAR Detects basic grammatical errors."); } else if (inp == "" || inp == "exit") { return; } else if (inp == "cls" || inp == "clear") { Console.Clear(); } else if (inp == "vocab") { for (int i = 0; i < book.book[pagenum - 1].Count; i++) { for (int x = 0; x < words.Length; x++) { book.book[pagenum - 1][i] = book.book[pagenum - 1][i].Replace(words[x], fancywords[x]); } } } else if (inp == "grammar") { for (int i = 0; i < book.book[pagenum - 1].Count; i++) { for (int x = 0; x < grammarerror.Length; x++) { if (book.book[pagenum - 1][i].Contains(grammarerror[x])) { Console.WriteLine("Warning Detected on line " + (i + 1) + ".\nError: " + grammarerror[x] + "\nSoloution:" + grammarsoloution[x]); } } } } else if (inp == "spell") { for (int i = 0; i < book.book[pagenum - 1].Count; i++) { for (int x = 0; x < spellerror.Length; x++) { book.book[pagenum - 1][i] = book.book[pagenum - 1][i].Replace(spellerror[x], spellsouloution[x]); } } } } } catch { Console.WriteLine("Err 1"); return; } }