本文整理汇总了C#中TextualExplanation.Expression方法的典型用法代码示例。如果您正苦于以下问题:C# TextualExplanation.Expression方法的具体用法?C# TextualExplanation.Expression怎么用?C# TextualExplanation.Expression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextualExplanation
的用法示例。
在下文中一共展示了TextualExplanation.Expression方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 virtual void GetExplain(TextualExplanation explanation, bool explainSubElements)
{
explanation.Comment(this);
if (!string.IsNullOrEmpty(getCondition()))
{
explanation.Write("IF ");
if (ConditionTree != null)
{
ConditionTree.GetExplain(explanation);
}
else
{
explanation.Write(getCondition());
}
explanation.WriteLine(" THEN");
explanation.Indent(2, () => explanation.Expression(this));
explanation.WriteLine("END IF");
}
else
{
explanation.Expression(this);
explanation.WriteLine();
}
}
示例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 virtual void GetExplain(TextualExplanation explanation, bool explainSubElements)
{
explanation.Comment(this);
explanation.Expression(this);
}
示例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 virtual void GetExplain(TextualExplanation explanation, bool explainSubElements)
{
if (PreConditions.Count > 0)
{
explanation.Write("IF ");
if (PreConditions.Count > 1)
{
// Prepare the space for the following ANDs
explanation.Write(" ");
}
bool first = true;
foreach (PreCondition preCondition in PreConditions)
{
if (!first)
{
explanation.WriteLine();
explanation.Write(" AND ");
}
preCondition.GetExplain(explanation, explainSubElements);
first = false;
}
explanation.WriteLine(" THEN");
explanation.Indent(2, () =>
{
explanation.Header(this);
explanation.Expression(this);
});
}
else
{
explanation.WriteLine();
explanation.Indent(2, () =>
{
explanation.Header(this);
explanation.Expression(this);
});
}
}