Пример #1
0
        /// <summary>
        /// Formats an exception to string
        /// </summary>
        /// <param name="exception"></param>
        /// <returns></returns>
        public static string ItsRenderException(this System.Exception exception)
        {
            StringBuilder output = new StringBuilder();

            output.AppendLine();
            output.AppendLine("#####################################");
            output.AppendLine(string.Format("## Timestamp: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff").Replace('T', ' ')));
            output.AppendLine();

            output.AppendLine("#####################################");
            output.AppendLine("## Environment");
            output.AppendLine("##");
            output.AppendLine(string.Format("Machine Name: {0}", Environment.MachineName));
            output.AppendLine(string.Format("Current Directory: {0}", Environment.CurrentDirectory));
            output.AppendLine(string.Format("Is 64 Bit Operating System: {0}", Environment.Is64BitOperatingSystem));
            output.AppendLine(string.Format("Is 64 Bit Process: {0}", Environment.Is64BitProcess));
            output.AppendLine(string.Format("OS Version: {0}", Environment.OSVersion));
            output.AppendLine(string.Format("Processor Count: {0}", Environment.ProcessorCount));
            output.AppendLine(string.Format("CLR Version: {0}", Environment.Version));
            output.AppendLine();

            output.AppendLine("#####################################");
            output.AppendLine("## Summary");
            output.AppendLine("##");
            output.Append(ItsExtensions.ItsRenderExceptionShort(exception));
            output.AppendLine();

            output.Append(ItsExceptionRenderExtension.Render(exception));

            ItsExtensions.RenderExceptionHelper(output, exception, false);

            return(output.ToString());
        }
Пример #2
0
 public static string ItsToDataSizeString(this decimal dSize, int digits, CultureInfo ci)
 {
     return(ItsExtensions.ItsToDataSizeStringHelper(dSize, digits, ci));
 }
Пример #3
0
 public static string ItsToDataSizeString(this ulong size, int digits, CultureInfo ci)
 {
     return(ItsExtensions.ItsToDataSizeStringHelper(Convert.ToDecimal(size), digits, ci));
 }
Пример #4
0
 public static string ItsToDataSizeString(this uint size, int digits)
 {
     return(ItsExtensions.ItsToDataSizeStringHelper(Convert.ToDecimal(size), digits));
 }