private void AssertValid(int index)
{
var comToDel = _commands[index];
if (comToDel is ICommandDeclaration)
{
AssertDeclarationCommand(index);
}
if (comToDel is ICommandWithArgument)
{
AssertCommandWithArgument(index);
}
if (comToDel is ICommandSetter)
{
AssertCommandSetter(index);
}
if (comToDel is ICommandWithConstruction)
{
AssertCommandWithConstruction(index);
}
}