本文整理汇总了C#中IConstraint.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IConstraint.ToString方法的具体用法?C# IConstraint.ToString怎么用?C# IConstraint.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConstraint
的用法示例。
在下文中一共展示了IConstraint.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintItemHtml
private static void PrintItemHtml(SizeableType pThis, PEREffectiveConstraint cns, StreamWriterLevel o, long itemNo, IConstraint innerTypeConstraint)
{
int inc = ((pThis.minItems(cns) == pThis.maxItems(cns) ? 0 : 1));
string cssClass = "EvenRow";
o.WriteLine("<tr class=\"" + cssClass + "\">");
o.WriteLine("<td class=\"no\">{0}</td>", (itemNo) == -1 ? "∞" : (itemNo + inc).ToString());
o.WriteLine("<td class=\"field\">Item #{0}</td>", (itemNo) == -1 ? "∞" : itemNo.ToString());
o.WriteLine("<td class=\"comment\">{0}</td>", "");
o.WriteLine("<td class=\"type\">{0}</td>", InternalTypeName(pThis));
string withComponentPart = string.Empty;
if (innerTypeConstraint!=null)
{
withComponentPart = "<span style=\"color: yellow\">";
withComponentPart += " (" + innerTypeConstraint.ToString() + ")";
withComponentPart += "</span>" + ICDBType.WithComponentWhy;
ICDBackend.m_WithComponentMustBeExplained = true;
}
o.WriteLine("<td class=\"constraint\">{0}</td>", o.Constraint(pThis.ItemConstraint(cns) + withComponentPart));
ArrayType ppthis = pThis as ArrayType;
if (ppthis != null && ppthis.m_type.GetFinalType() is IntegerType && ppthis.m_type.MinBitsInPER == 0 && ppthis.m_type.MaxBitsInPER == 0)
{
o.WriteLine("<td class=\"min\">0{0}</td>", ICDBType.ZeroBitsWhy);
o.WriteLine("<td class=\"max\">0{0}</td>", ICDBType.ZeroBitsWhy);
ICDBackend.m_ZeroBitsMustBeExplained = true;
}
else
{
o.WriteLine("<td class=\"min\">{0}</td>", (pThis.minItemBitsInPER(cns) == -1 ? "∞" : pThis.minItemBitsInPER(cns).ToString()));
o.WriteLine("<td class=\"max\">{0}</td>", (pThis.maxItemBitsInPER(cns) == -1 ? "∞" : pThis.maxItemBitsInPER(cns).ToString()));
}
o.WriteLine("</tr>");
}