public ulong GetUint(CompactUnsigned64bitInteger objectVal)
{
if (objectVal is CompactUintZero)
{
return (objectVal as CompactUintZero).Uint;
}
else if (objectVal is CompactUint7bitvalues)
{
return (objectVal as CompactUint7bitvalues).Uint;
}
else if (objectVal is CompactUint14bitvalues)
{
return (objectVal as CompactUint14bitvalues).Uint;
}
else if (objectVal is CompactUint21bitvalues)
{
return (objectVal as CompactUint21bitvalues).Uint;
}
else if (objectVal is CompactUint28bitvalues)
{
return (objectVal as CompactUint28bitvalues).Uint;
}
else if (objectVal is CompactUint35bitvalues)
{
return (objectVal as CompactUint35bitvalues).Uint;
}
else if (objectVal is CompactUint42bitvalues)
{
return (objectVal as CompactUint42bitvalues).Uint;
}
else if (objectVal is CompactUint49bitvalues)
{
return (objectVal as CompactUint49bitvalues).Uint;
}
else if (objectVal is CompactUint64bitvalues)
{
return (objectVal as CompactUint64bitvalues).Uint;
}
else
{
throw new Exception("The CompactUnsigned64bitInteger type is not right.");
}
}