示例#1
0
        public void ToFormattedString()
        {
            PageLine line = new PageLine();

            for (int i = 0; i < PageLine.Size; i++)
            {
                line[i] = (byte)(0x30 + i);
            }

            Console.WriteLine(line.ToString());
            Console.WriteLine();
            Console.WriteLine(line.ToString("G"));
            Console.WriteLine();
            Console.WriteLine(line.ToString("H"));
            Console.WriteLine();
            Console.WriteLine(line.ToString("C"));
            Console.WriteLine();
        }
示例#2
0
 public void ToStringInvalidFormat()
 {
     try
     {
         PageLine line = new PageLine();
         Console.WriteLine(line.ToString("X"));
     }
     catch (FormatException ex)
     {
         Console.WriteLine(ex.Message);
         throw ex;
     }
 }