本文整理汇总了C#中System.Object.ToDictionary方法的典型用法代码示例。如果您正苦于以下问题:C# Object.ToDictionary方法的具体用法?C# Object.ToDictionary怎么用?C# Object.ToDictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Object
的用法示例。
在下文中一共展示了Object.ToDictionary方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObjectValue
/// <summary>
/// Creates a new instance and sets the values.
/// </summary>
/// <param name="values">The initial values to use.</param>
public ObjectValue(Object values)
: this(values.ToDictionary())
{
}
示例2: Run
/// <summary>
/// Begins the interpretation of the current parse tree.
/// </summary>
/// <param name="query">The query to extend.</param>
/// <param name="values">
/// The values in an anonymous object - containing name - value pairs.
/// </param>
public static void Run(this QueryContext query, Object values)
{
var symbols = values.ToDictionary();
query.Run(symbols);
}
示例3: Headers
/// <summary>
/// Sets the headers with the name of the properties and their
/// assigned values.
/// </summary>
/// <param name="obj">The object to decompose.</param>
/// <returns>The current instance.</returns>
public VirtualResponse Headers(Object obj)
{
var headers = obj.ToDictionary();
return Headers(headers);
}
示例4: Evaluate
/// <summary>
/// Execute the evaluation of this parser instance with external symbols.
/// </summary>
/// <param name="parser">The parser to extend.</param>
/// <param name="input">The input to evaluate.</param>
/// <param name="values">
/// The values in an anonymous object - containing name - value pairs.
/// </param>
/// <returns>The value from the evaluation.</returns>
public static Value Evaluate(this Parser parser, String input, Object values)
{
var symbols = values.ToDictionary();
return parser.Evaluate(input, symbols);
}