コード例 #1
0
 static private void displayPaste(string address)
 {
     CmdUtil.colorWrite("The address ");
     CmdUtil.colorWrite(address, ConsoleColor.Black, ConsoleColor.Yellow);
     CmdUtil.colorWrite(" was written to the clipboard.\n");
     Clipboard.SetText(address);
 }
コード例 #2
0
        static private Boolean outputDatabase()                                                                         //TODO
        {
            //TODO: Output database in human-readable format


            List <PasteDBRow> results = db.returnAll();

            foreach (PasteDBRow row in results)
            {
                string filename = Path.GetFileName(row.location);
                //Console.WriteLine(filename + "\t" + "\t" + row.uploadAddress);
                //CmdUtil.colorWriteLine(filename + "\t" + "\t" + row.uploadAddress, ConsoleColor.Green);
                CmdUtil.colorWrite(String.Format("{0,-30}", filename), ConsoleColor.White);
                CmdUtil.colorWriteLine(String.Format("{0,30}", row.uploadAddress), ConsoleColor.Gray);
                if (row.tags.Count > 0)
                {
                    CmdUtil.colorWrite("\t" + String.Join(", ", row.tags), ConsoleColor.Gray);
                }
                System.Console.WriteLine(System.Environment.NewLine);
            }

            return(true);
        }