示例#1
0
        public void button_1(object sender, RoutedEventArgs e)
        {
            foreach (string Row in File.ReadAllLines("2020.txt", Encoding.Default))
            {
                var row = new Text2(Row);
                row.Size(18)
                .Color(ConsoleColor.Red)
                .BackgroundColor(ConsoleColor.Black)
                .Bold(true)
                .Underline(true);
                var html = row.Print();
                data.Items.Add(Row);
            }

            string[] lines  = System.IO.File.ReadAllLines("2020.txt");
            string[] lines2 = System.IO.File.ReadAllLines("2021.xml");
            var      text   = new MainWindow();
            int      b      = lines.GetHashCode();
            int      bb     = lines2.GetHashCode();

            red.Content = bb + " " + " " + b;

            //Text ler = new Text(text);
            //ler.fff(lines);
            //ler.floyd(lines2);
        }
示例#2
0
        public static Text2 HeaderLevel(this Text2 text, int headerLevel)
        {
            const int NormalText = 0;
            const int MinHeader  = 6;

            if (headerLevel <= NormalText)
            {
                text.HeaderLevel = NormalText;
            }
            else if (headerLevel >= MinHeader)
            {
                text.HeaderLevel = MinHeader;
            }
            else
            {
                text.HeaderLevel = headerLevel;
            }

            return(text);
        }
示例#3
0
        public static Text2 Size(this Text2 text, int size)
        {
            const int MinFontSize = 6;
            const int MaxFontSize = 72;

            if (size <= MinFontSize)
            {
                text.Size = MinFontSize;
            }
            else if (size >= MaxFontSize)
            {
                text.Size = MaxFontSize;
            }
            else
            {
                text.Size = size;
            }


            return(text);
        }
示例#4
0
 public static Text2 Underline(this Text2 text, bool underline)
 {
     text.Underline = underline;
     return(text);
 }
示例#5
0
 public static Text2 Italic(this Text2 text, bool italic)
 {
     text.Italic = italic;
     return(text);
 }
示例#6
0
 public static Text2 Bold(this Text2 text, bool bold)
 {
     text.Bold = bold;
     return(text);
 }
示例#7
0
 public static Text2 BackgroundColor(this Text2 text, ConsoleColor color)
 {
     text.BackgroundColor = color;
     return(text);
 }
示例#8
0
 public static Text2 Color(this Text2 text, ConsoleColor color)
 {
     text.Color = color;
     return(text);
 }