asked on
public static int GetObjectSubstrLevel(simpackcomslvLib.IScrNamedObject obj)
{
int level = 0;
while (true)
{
switch (obj.parent.category)
{
case "Model":
return level;
case "Variant":
return level;
case "Substr":
level += 1;
obj = obj.parent;
continue;
default:
obj = obj.parent;
continue;
}
}
}
public static int GetObjectSubstrLevel(simpackcomslvLib.IScrBody obj)
{
int level = 0;
while (true)
{
switch (obj.parent.category)
{
case "Model":
return level;
case "Variant":
return level;
case "Substr":
level += 1;
obj = obj.parent;
continue;
default:
obj = obj.parent;
continue;
}
}
}
C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).
TRUSTED BY