示例#1
0
        /// <summary>
        /// Converts the value of the current <see cref="Operation"/> object to its equivalent string representation
        /// using the specified format and culture-specific format information.
        /// </summary>
        /// <param name="format">The format string. May contain the names of the properties to print enclosed in curly braces like '{<see cref="P:OperationNumber"/>}'.
        /// If a given property could not be found on the top-level, then it is looked after in the CustomData dictionary.
        /// If it wasn't found there either, a default string is printed.</param>
        /// <param name="options">Options to use for controlling formatting.</param>
        /// <param name="formatProvider">The format provider to use for formatting.</param>
        /// <returns>A string representation of value of the current <see cref="Operation"/> object as specified by format and provider.</returns>
        public string ToString(string format, ObjectFormatterOptions options, IFormatProvider formatProvider)
        {
            ExtendedObjectExpressionFormatter <Operation> formatter = new ExtendedObjectExpressionFormatter <Operation>(ResolveProperty);

            formatter.Options = options;
            return(formatter.ToString(this, format));
        }
示例#2
0
        /// <summary>
        /// Parses a string that tells how to format an object using macros within curly braces.
        /// </summary>
        /// <param name="graph">The object graph to use. Must not be null.</param>
        /// <param name="format">The format string, using the property values in curly braces, like {Property}. Must not be empty.</param>
        /// <param name="options">Controls the formatting process.</param>
        /// <returns>The formatted string.</returns>
        public static string ToString <T>(T graph, string format, ObjectFormatterOptions options)
        {
            ExtendedObjectExpressionFormatter <T> formatter = new ExtendedObjectExpressionFormatter <T>();

            formatter.Options = options;
            return(formatter.ToString(graph, format));
        }
示例#3
0
 /// <summary>
 /// Parses a string that tells how to format an object using macros within curly braces.
 /// </summary>
 /// <typeparam name="T">The type of the object to format.</typeparam>
 /// <param name="graph">The object graph to use. Must not be null.</param>
 /// <param name="format">The format string, using the property values in curly braces, like {Property}. Must not be empty.</param>
 /// <param name="options">Controls the formatting process.</param>
 /// <returns>The formatted string.</returns>
 public static string ToString <T>(T graph, string format, ObjectFormatterOptions options)
 {
     return(ObjectExpressionFormatter <T> .ToString(graph, format, options));
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ObjectExpressionFormatter&lt;TInput&gt;"/> class.
 /// </summary>
 public ObjectExpressionFormatter()
 {
     Options = ObjectFormatterOptions.Default;
 }