public OutlookSqliteQuery(string sqlitePath) { Console.WriteLine("Loading data ..."); using (var conn = new SQLiteConnection($"Data Source={sqlitePath}")) { conn.Open(); using (var cmd = conn.CreateCommand()) { Console.WriteLine("Loading folders ..."); cmd.CommandText = "select Record_RecordId, Folder_ParentID, Folder_Name from Folders where Folder_Name is not null"; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { _folders.Add(reader.GetInt32(0), new Folder { ParentID = reader.GetInt32(1), Name = reader.GetString(2) }); } } Console.WriteLine("Loading emails ..."); cmd.CommandText = "select Message_MessageID, Record_RecordID, Record_FolderID, Threads_ThreadID from Mail where Message_MessageID is not null"; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { var msgId = reader.GetString(0); if (msgId.StartsWith("<") && msgId.EndsWith(">")) { msgId = msgId.Substring(1, msgId.Length - 2); } var mail = new Mail { RecordID = reader.GetInt32(1), FolderID = reader.GetInt32(2), ThreadID = reader.GetInt32(3) }; if (_messages.TryAdd(msgId, mail)) { if (_threads.TryGetValue(mail.ThreadID, out var thread)) { thread.Count++; if (thread.FirstRecordID > mail.RecordID) { thread.FirstRecordID = mail.RecordID; } } else { _threads.Add(mail.ThreadID, new Thread { Count = 1, FirstRecordID = mail.RecordID }); } } } } Console.WriteLine("Loading data complete"); } } }
public void createStartUpAnimation() { Mail paul = new Mail(); paul.info(); SlowPrint Slow = new SlowPrint(); Console.Clear(); GetLocation test = new GetLocation(); test.GetLocationProperty(); wait(3000); try { Slow.Print("FANCY MODE ACTIVATED..."); } catch (Exception) { } wait(3000); Console.Clear(); wait(3000); try { Slow.Print("INITIATING BOOT SEQUENCE..."); } catch (Exception) { } wait(3000); Console.Clear(); wait(3000); foreach (String s in startUpText) { Console.Write(s); Console.Write("\n"); wait(50); } wait(3000); Console.Clear(); wait(3000); try { Slow.Print("LOADING COMPONENTS..."); } catch (Exception) { } wait(3000); foreach (String s in loadingComponents) { Console.Write(s); Console.Write("\n"); wait(50); } wait(3000); Console.Clear(); Process[] processlist = Process.GetProcesses(); Console.WriteLine("LOADING THE PROCESSES CURRENTLY RUNNING"); wait(3000); foreach (Process theprocess in processlist) { Console.WriteLine("Process: {0} ID: {1}", theprocess.ProcessName, theprocess.Id); wait(50); } wait(3000); try { Slow.Print("BOOT SEQUENCE COMPLETE..."); Console.Write("\n"); Console.Write("STARTING THE BATTLESHIP..."); } catch (Exception) { } wait(3000); Console.Clear(); wait(3000); } // Console.Clear();