Exemplo n.º 1
0
 /// <summary>
 /// Convert the matrix to a string
 /// </summary>
 /// <returns></returns>
 public static string ToString(this Matrix3D matrix, string format, int columnWidth)
 {
     if (format == null)
     {
         throw new ArgumentNullException("format");
     }
     return(matrix.ConvertToString(format, "\t", "\n", columnWidth, CultureInfo.InvariantCulture));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Convert the matrix to a string
 /// </summary>
 /// <param name="matrix">
 /// The matrix.
 /// </param>
 /// <param name="format">
 /// The format.
 /// </param>
 /// <param name="columnSeparator">
 /// The column Separator.
 /// </param>
 /// <param name="lineSeparator">
 /// The line Separator.
 /// </param>
 /// <param name="columnWidth">
 /// The column Width.
 /// </param>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <returns>
 /// A string.
 /// </returns>
 public static string ToString(
     this Matrix3D matrix,
     string format,
     string columnSeparator,
     string lineSeparator,
     int columnWidth,
     CultureInfo provider)
 {
     return(matrix.ConvertToString(format, columnSeparator, lineSeparator, columnWidth, provider));
 }
        /// <summary>
        /// Converts the value into a string.
        /// </summary>
        public override string ConvertToString(object value, IValueSerializerContext context)
        {
            if (value is Matrix3D)
            {
                Matrix3D instance = (Matrix3D)value;


                #pragma warning suppress 6506 // instance is obviously not null
                return(instance.ConvertToString(null, System.Windows.Markup.TypeConverterHelper.InvariantEnglishUS));
            }

            return(base.ConvertToString(value, context));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Convert the matrix to a string using invariant culture and '\t' and '\n' as separators.
 /// </summary>
 /// <param name="matrix">
 /// The matrix.
 /// </param>
 /// <param name="columnWidth">
 /// The column Width.
 /// </param>
 /// <returns>
 /// The to string.
 /// </returns>
 public static string ToString(this Matrix3D matrix, int columnWidth)
 {
     return(matrix.ConvertToString("N" + columnWidth, 20));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Converts to string using the specified format and the invariant culture
        /// </summary>
        /// <param name="matrix">
        /// The matrix.
        /// </param>
        /// <param name="format">
        /// Format string, e.g. "N8"
        /// </param>
        /// <param name="columnWidth">
        /// Width of column, number of characters
        /// </param>
        /// <returns>
        /// A string.
        /// </returns>
        internal static string ConvertToString(this Matrix3D matrix, string format, int columnWidth)
        {
            CultureInfo provider = CultureInfo.InvariantCulture;

            return(matrix.ConvertToString(format, "\t", "\n", columnWidth, provider));
        }