Ejemplo n.º 1
0
        public static void Print_AppInfo()
        {
            var table = new ConsoleTables.ConsoleTable(new ConsoleTables.ConsoleTableOptions()
            {
                EnableCount     = false,
                NumberAlignment = ConsoleTables.Alignment.Left
            });

            //Print out Application information
            table.Columns.Add("App name");
            table.Columns.Add("Data Collector");
            table.AddRow("Version", "0.1");
            table.AddRow("Author", "Alireza Keshavarz");
            table.AddRow("Date", "05/10/2019");
            table.Write(ConsoleTables.Format.Alternative);

            table.Rows.Clear(); table.Columns.Clear();

            //Print out Platforms Status
            table.Columns.Add("Platform");
            table.Columns.Add("Ready?");
            table.AddRow("Instagram", "Yes");
            table.AddRow("Twitter", "No");
            table.AddRow("Telegram", "No");
            Colorful.StyleSheet styleSheet = new Colorful.StyleSheet(System.Drawing.Color.White);
            styleSheet.AddStyle("Yes[a-z]*", System.Drawing.Color.Green);
            styleSheet.AddStyle("No[a-z]*", System.Drawing.Color.Red);
            Colorful.Console.WriteLineStyled(table.ToMarkDownString(), styleSheet);
        }
Ejemplo n.º 2
0
        public static void Print_Table_With_TF_Style(System.Collections.Generic.List <string[]> rows)
        {
            Console.WriteLine();

            var table = new ConsoleTables.ConsoleTable();

            table.Options.EnableCount = false;

            table.AddColumn(rows[0]);
            for (int i = 1; i < rows.Count; i++)
            {
                table.AddRow(rows[i]);
            }

            Colorful.StyleSheet _Temp1 = new Colorful.StyleSheet(System.Drawing.Color.White);
            _Temp1.AddStyle("True[a-z]*", System.Drawing.Color.Green);
            _Temp1.AddStyle("False[a-z]*", System.Drawing.Color.Red);
            Colorful.Console.WriteLineStyled(table.ToMarkDownString(), _Temp1);
        }