public static byte[] PackEnumerable(string description, IEnumerable args)
{
DataConverter.PackContext packContext = new DataConverter.PackContext();
packContext.conv = DataConverter.CopyConv;
packContext.description = description;
IEnumerator enumerator = args.GetEnumerator();
bool flag = enumerator.MoveNext();
packContext.i = 0;
while (packContext.i < description.Length)
{
object oarg;
if (flag)
{
oarg = enumerator.Current;
}
else
{
if (packContext.repeat != 0)
{
break;
}
oarg = null;
}
int i = packContext.i;
if (DataConverter.PackOne(packContext, oarg))
{
flag = enumerator.MoveNext();
if (packContext.repeat > 0)
{
if (--packContext.repeat > 0)
{
packContext.i = i;
}
else
{
packContext.i++;
}
}
else
{
packContext.i++;
}
}
else
{
packContext.i++;
}
}
return(packContext.Get());
}