// Validate an item name.
internal static void ValidateName(VsaEngine engine, String name)
{
// Validate the name with the engine.
if(!engine.IsValidIdentifier(name))
{
throw new VsaException(VsaError.ItemNameInvalid);
}
// Make sure that there are no items with this name.
foreach(VsaItem item in engine.Items)
{
if(item.Name == name)
{
throw new VsaException(VsaError.ItemNameInUse);
}
}
}