本文整理汇总了C#中ArrayType.maxItems方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayType.maxItems方法的具体用法?C# ArrayType.maxItems怎么用?C# ArrayType.maxItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayType
的用法示例。
在下文中一共展示了ArrayType.maxItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintCInitialize
public static void PrintCInitialize(ArrayType pThis, PEREffectiveConstraint cns,
Asn1Value defauleVal, StreamWriterLevel c, string typeName, string varName, int lev, int arrayDepth)
{
long min = pThis.minItems(cns);
long max = pThis.maxItems(cns);
string i = "i" + arrayDepth.ToString();
string prefix = "";
bool topLevel = !varName.Contains("->");
if (topLevel)
prefix = varName + "->";
else
{
prefix = varName + ".";
}
ArrayValue arVal = defauleVal as ArrayValue;
if (arVal == null)
{
c.P(lev);
c.WriteLine("{0}nCount = 0;", prefix);
c.P(lev); c.WriteLine("for({0}=0;{0}<{1};{0}++)", i, pThis.maxItems(cns));
c.P(lev); c.WriteLine("{");
((ISCCType)pThis.m_type).PrintCInitialize(pThis.m_type.PEREffectiveConstraint, pThis.m_type.GetOneValidValue(), c,
typeName + "_arr", prefix + "arr[" + i + "]", lev + 1, arrayDepth + 1);
c.P(lev); c.WriteLine("}");
}
else
{
c.P(lev);
c.WriteLine("{0}nCount = {1};", prefix, arVal.m_children.Count);
for (int k = 0; k < arVal.m_children.Count; k++)
{
c.P(lev); c.WriteLine("{");
((ISCCType)pThis.m_type).PrintCInitialize(pThis.m_type.PEREffectiveConstraint, arVal.m_children[k], c,
typeName + "_arr", prefix + "arr[" + k.ToString() + "]", lev + 1, arrayDepth + 1);
c.P(lev); c.WriteLine("}");
}
}
}
示例2: PrintCIsConstraintValid
public static void PrintCIsConstraintValid(ArrayType pThis, PEREffectiveConstraint cns, StreamWriterLevel c, string errorCode, string typeName, string varName, int lev, int arrayDepth)
{
long min = pThis.minItems(cns);
long max = pThis.maxItems(cns);
string i = "i" + arrayDepth.ToString();
string prefix = "";
bool topLevel = !varName.Contains("->");
CSSType.PrintCIsConstraintValid(pThis, cns, c, errorCode, typeName, varName, lev, arrayDepth);
c.WriteLine();
if (topLevel)
prefix = varName + "->";
else
{
prefix = varName + ".";
}
c.P(lev); c.WriteLine("for({0}=0;{0}<{1}nCount;{0}++)", i, prefix);
c.P(lev); c.WriteLine("{");
((ISCCType)pThis.m_type).PrintCIsConstraintValid(pThis.m_type.PEREffectiveConstraint, c, errorCode + "_elem",
typeName + "_arr", prefix + "arr[" + i + "]", lev + 1, arrayDepth + 1);
c.P(lev); c.WriteLine("}");
}
示例3: PrintHTypeDeclaration
public static void PrintHTypeDeclaration(ArrayType pThis, PEREffectiveConstraint cns, StreamWriterLevel h, string typeName, string varName, int lev)
{
long min = pThis.minItems(cns);
long max = pThis.maxItems(cns);
h.WriteLine("struct {");
// h.WriteLine("struct {0} {{", typeName);
// if (min != max)
{
h.P(lev + 2);
h.WriteLine("long nCount;");
}
h.P(lev + 2); ((ISCCType)pThis.m_type).PrintHTypeDeclaration(pThis.m_type.PEREffectiveConstraint, h, typeName + "_arr"/*+varName*/, "arr", lev + 1);
h.WriteLine(" arr[{0}];", max);
h.P(lev+1);
h.Write("}");
}