本文整理汇总了C#中TextualExplanation.ExplainList方法的典型用法代码示例。如果您正苦于以下问题:C# TextualExplanation.ExplainList方法的具体用法?C# TextualExplanation.ExplainList怎么用?C# TextualExplanation.ExplainList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextualExplanation
的用法示例。
在下文中一共展示了TextualExplanation.ExplainList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetExplain
/// <summary>
/// Builds the explanation of the element
/// </summary>
/// <param name="explanation"></param>
/// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
{
Structure.GetExplain(explanation);
explanation.Write("{");
explanation.Indent(2, () => explanation.ExplainList(Associations, explainSubElements, ", ", element =>
{
explanation.WriteLine();
element.Key.GetExplain(explanation);
explanation.Write(" => ");
element.Value.GetExplain(explanation);
}));
explanation.WriteLine();
explanation.Write("}");
}
示例2: GetExplain
/// <summary>
/// Builds the explanation of the element
/// </summary>
/// <param name="explanation"></param>
/// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
{
explanation.ExplainList(Arguments, true, ".", expression => expression.GetExplain(explanation));
}
示例3: GetExplain
/// <summary>
/// Builds the explanation of the element
/// </summary>
/// <param name="explanation"></param>
/// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
{
Called.GetExplain(explanation);
explanation.Write("(");
explanation.ExplainList(ActualParameters, explainSubElements, ", ",
element => element.GetExplain(explanation));
if (NamedActualParameters.Count > 0)
{
explanation.Indent(2, () =>
{
if (ActualParameters.Count > 0)
{
explanation.Write(", ");
}
explanation.ExplainList(NamedActualParameters, explainSubElements, ", ", pair =>
{
if (AllParameters.Count > 1)
{
explanation.WriteLine();
}
pair.Key.GetExplain(explanation);
explanation.Write(" => ");
pair.Value.GetExplain(explanation);
});
});
}
explanation.Write(")");
}
示例4: GetExplain
/// <summary>
/// Builds the explanation of the element
/// </summary>
/// <param name="explanation"></param>
/// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
{
explanation.Write("FUNCTION ");
explanation.ExplainList(Parameters, explainSubElements, ", ", parameter =>
{
explanation.Write(parameter.Name);
explanation.Write(" : ");
explanation.Write(parameter.TypeName);
});
explanation.Write(" => ");
explanation.Write(Expression);
}
示例5: GetExplain
/// <summary>
/// Builds the explanation of the element
/// </summary>
/// <param name="explanation"></param>
/// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
public override void GetExplain(TextualExplanation explanation, bool explainSubElements = true)
{
if (ListElements.Count > 0)
{
explanation.Write("[");
explanation.Indent(2,
() => explanation.ExplainList(ListElements, explainSubElements, ", ",
element => element.GetExplain(explanation, explainSubElements)));
explanation.Write("]");
}
else
{
explanation.Write("[]");
}
}