本文整理汇总了C#中TextualExplanation.Comment方法的典型用法代码示例。如果您正苦于以下问题:C# TextualExplanation.Comment方法的具体用法?C# TextualExplanation.Comment怎么用?C# TextualExplanation.Comment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextualExplanation
的用法示例。
在下文中一共展示了TextualExplanation.Comment方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
explanation.Expression(this);
}
示例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.Indent(2, () =>
{
foreach (Step step in Steps)
{
step.GetExplain(explanation, explainSubElements);
explanation.WriteLine();
}
});
}
示例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 (string.IsNullOrEmpty(Comment))
{
if (Type != null)
{
explanation.Comment(Type);
}
}
else
{
explanation.Comment(this);
}
explanation.Write(Name);
explanation.Write(" : ");
explanation.Write(TypeName);
if (Value != null)
{
explanation.Write(" = ");
explanation.Write(Value.LiteralName);
}
explanation.WriteLine();
}
示例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)
{
explanation.Comment(this);
explanation.Write("FUNCTION ");
explanation.Write(Name);
explanation.Write(" (");
if (FormalParameters.Count > 0)
{
explanation.Indent(2, () =>
{
bool first = true;
foreach (Parameter parameter in FormalParameters)
{
if (first)
{
explanation.WriteLine();
first = false;
}
else
{
explanation.WriteLine(",");
}
parameter.GetExplain(explanation, true);
}
});
}
explanation.WriteLine(")");
explanation.Write("RETURNS ");
explanation.WriteLine(TypeName);
{
bool first = true;
foreach (Case cas in Cases)
{
if (!first)
{
explanation.Write("ELSE ");
}
cas.GetExplain(explanation, explainSubElements);
explanation.WriteLine();
first = false;
}
}
explanation.Write("END FUNCTION");
}
示例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 virtual void GetExplain(TextualExplanation explanation, bool explainSubElements)
{
int indent = 0;
if (PreConditions.Count > 0)
{
indent = 2;
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();
explanation.WriteLine("THEN");
}
else
{
explanation.WriteLine();
}
explanation.Indent(indent, () =>
{
if (Name.CompareTo(EnclosingRule.Name) != 0)
{
explanation.Comment(Name);
}
foreach (Action action in Actions)
{
explanation.Write();
action.GetExplain(explanation, explainSubElements);
explanation.WriteLine();
}
if (explainSubElements)
{
foreach (Rule subRule in SubRules)
{
subRule.GetExplain(explanation, explainSubElements);
}
}
});
}
示例6: 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)
{
explanation.Comment(this);
if (!IsAbstract)
{
explanation.Write("STRUCTURE ");
}
else
{
explanation.Write("INTERFACE ");
}
explanation.WriteLine(Name);
explanation.Indent(2, () =>
{
foreach (Structure structure in Interfaces)
{
if (structure != null)
{
explanation.Write("IMPLEMENTS ");
explanation.WriteLine(structure.Name);
}
}
foreach (StructureElement element in Elements)
{
element.GetExplain(explanation, explainSubElements);
}
if (!IsAbstract)
{
foreach (Procedure procedure in Procedures)
{
procedure.GetExplain(explanation, explainSubElements);
}
foreach (StateMachine stateMachine in StateMachines)
{
stateMachine.GetExplain(explanation, explainSubElements);
}
foreach (Rule rule in Rules)
{
rule.GetExplain(explanation, explainSubElements);
}
}
});
if (!IsAbstract)
{
explanation.WriteLine("END STRUCTURE");
}
else
{
explanation.WriteLine("END INTERFACE");
}
}
示例7: 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();
}
}
示例8: 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.Write(Name);
if (!String.IsNullOrEmpty(getValue()))
{
explanation.WriteLine(" : " + getValue());
}
else
{
explanation.WriteLine();
}
}
示例9: 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(Name);
explanation.Indent(2, () =>
{
foreach (Action action in Actions)
{
action.GetExplain(explanation, explainSubElements);
explanation.WriteLine();
}
});
explanation.WriteLine("IMPLIES");
explanation.Indent(2, () =>
{
foreach (Expectation expectation in Expectations)
{
expectation.GetExplain(explanation, explainSubElements);
explanation.WriteLine();
}
});
}
示例10: 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.Write("PROCEDURE ");
explanation.Write(Name);
if (FormalParameters.Count > 0)
{
bool first = true;
explanation.Write("(");
if (FormalParameters.Count > 1)
{
explanation.WriteLine();
}
explanation.Indent(4, () =>
{
foreach (Parameter parameter in FormalParameters)
{
if (!first)
{
explanation.WriteLine(",");
}
explanation.Write(parameter.Name);
explanation.Write(" : ");
explanation.Write(parameter.TypeName);
first = false;
}
});
explanation.WriteLine(")");
}
else
{
explanation.WriteLine("()");
}
explanation.Indent(2, () =>
{
foreach (Rule rule in Rules)
{
rule.GetExplain(explanation, explainSubElements);
explanation.WriteLine();
}
});
explanation.WriteLine("END PROCEDURE ");
}
示例11: 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.Write("NAMESPACE ");
explanation.WriteLine(Name);
}
示例12: 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);
string typeName = TypeName;
if (Type != null)
{
typeName = Type.FullName;
}
explanation.Write("FIELD ");
explanation.Write(Name);
explanation.Write(" : ");
explanation.WriteLine(typeName);
}
示例13: 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);
bool first = true;
bool condition = false;
foreach (RuleCondition ruleCondition in RuleConditions)
{
if (!first)
{
explanation.WriteLine("ELSE");
}
ruleCondition.GetExplain(explanation, explainSubElements);
first = false;
condition = condition || ruleCondition.PreConditions.Count > 0;
}
if (condition)
{
explanation.WriteLine("END IF");
}
}