Example #1
0
 /// <summary>
 ///   Prints the <seealso cref="XConfig" /> information
 /// </summary>
 /// <param name="cfg"> <seealso cref="XConfig" /> Containing information to be printed </param>
 /// <param name="verboselevel"> Verbosity level of the output </param>
 protected void PrintXConfig(XConfig cfg, int verboselevel = 0)
 {
     if (verboselevel >= 0)
     {
         UpdateStatus("FlashConfig:         0x{0:X08}", cfg.Config);
     }
     if (verboselevel >= 1)
     {
         UpdateStatus("Page Size:           0x{0:X}", cfg.PageSize);
         UpdateStatus("Meta Size:           0x{0:X}", cfg.MetaSize);
         UpdateStatus("Meta Type:           0x{0:X}", cfg.MetaType);
         UpdateStatus("Block Size (RAW):    0x{0:X}", cfg.BlockRawSize);
         UpdateStatus("Block Size:          0x{0:X}", cfg.BlockSize);
     }
     if (verboselevel >= 2)
     {
         UpdateStatus("Pages Per Block:     {0}", cfg.PagesPerBlock);
     }
     if (verboselevel >= 0)
     {
         UpdateStatus("Size Blocks:         0x{0:X}", cfg.SizeBlocks);
     }
     if (verboselevel >= 2)
     {
         UpdateStatus("Small BlocksCount:   0x{0:X}", cfg.SizeSmallBlocks);
         UpdateStatus("File Blocks:         0x{0:X}", cfg.FSBlocks);
     }
     if (verboselevel >= 1)
     {
         UpdateStatus(string.Format(new NumberFormatInfo {
             NumberGroupSeparator = " ", NumberDecimalDigits = 0
         }, "Size Bytes:          {0:N} B", cfg.SizeBytes));
         UpdateStatus(string.Format(new NumberFormatInfo {
             NumberGroupSeparator = " ", NumberDecimalDigits = 0
         }, "Size Bytes (RAW):    {0:N} B", cfg.SizeRawBytes));
         UpdateStatus("Size Readable:       {0}", GetSizeReadable(cfg.SizeBytes));
         UpdateStatus("Size Readable (RAW): {0}", GetSizeReadable(cfg.SizeRawBytes));
     }
     if (verboselevel >= 3)
     {
         UpdateStatus("Controller Type:     {0}", cfg.ControllerType);
         UpdateStatus("Block Type:          {0}", cfg.BlockType);
     }
 }
 /// <summary>
 ///   Prints the <seealso cref="XConfig" /> information
 /// </summary>
 /// <param name="cfg"> <seealso cref="XConfig" /> Containing information to be printed </param>
 /// <param name="verboselevel"> Verbosity level of the output </param>
 protected void PrintXConfig(XConfig cfg, int verboselevel = 0)
 {
     if(verboselevel >= 0)
         UpdateStatus(string.Format("FlashConfig:         0x{0:X08}", cfg.Config));
     if(verboselevel >= 1) {
         UpdateStatus(string.Format("Page Size:           0x{0:X}", cfg.PageSize));
         UpdateStatus(string.Format("Meta Size:           0x{0:X}", cfg.MetaSize));
         UpdateStatus(string.Format("Meta Type:           0x{0:X}", cfg.MetaType));
         UpdateStatus(string.Format("Block Size (RAW):    0x{0:X}", cfg.BlockRawSize));
         UpdateStatus(string.Format("Block Size:          0x{0:X}", cfg.BlockSize));
     }
     if(verboselevel >= 2)
         UpdateStatus(string.Format("Pages Per Block:     {0}", cfg.PagesPerBlock));
     if(verboselevel >= 0)
         UpdateStatus(string.Format("Size Blocks:         0x{0:X}", cfg.SizeBlocks));
     if(verboselevel >= 2) {
         UpdateStatus(string.Format("Small BlocksCount:   0x{0:X}", cfg.SizeSmallBlocks));
         UpdateStatus(string.Format("File Blocks:         0x{0:X}", cfg.FSBlocks));
     }
     if(verboselevel >= 1) {
         UpdateStatus(string.Format(new NumberFormatInfo {
                                                         NumberGroupSeparator = " ", NumberDecimalDigits = 0
                                                         }, "Size Bytes:          {0:N} B", cfg.SizeBytes));
         UpdateStatus(string.Format(new NumberFormatInfo {
                                                         NumberGroupSeparator = " ", NumberDecimalDigits = 0
                                                         }, "Size Bytes (RAW):    {0:N} B", cfg.SizeRawBytes));
         UpdateStatus(string.Format("Size Readable:       {0}", GetSizeReadable(cfg.SizeBytes)));
         UpdateStatus(string.Format("Size Readable (RAW): {0}", GetSizeReadable(cfg.SizeBytes)));
     }
     if(verboselevel >= 3) {
         UpdateStatus(string.Format("Controller Type:     {0}", cfg.ControllerType));
         UpdateStatus(string.Format("Block Type:          {0}", cfg.BlockType));
     }
 }