private void ShowPropertiesEditorFromPropertyGrid(CustomProperties props, object objectThatHasProperties)
{
CustomPropertyAppliesTo propertyTypes;
if (objectThatHasProperties is Character)
{
propertyTypes = CustomPropertyAppliesTo.Characters;
}
else if (objectThatHasProperties is RoomHotspot)
{
propertyTypes = CustomPropertyAppliesTo.Hotspots;
}
else if (objectThatHasProperties is InventoryItem)
{
propertyTypes = CustomPropertyAppliesTo.InventoryItems;
}
else if (objectThatHasProperties is RoomObject)
{
propertyTypes = CustomPropertyAppliesTo.Objects;
}
else if (objectThatHasProperties is Room)
{
propertyTypes = CustomPropertyAppliesTo.Rooms;
}
else
{
throw new AGSEditorException("Object not recognised to contain properties: " + objectThatHasProperties.ToString());
}
Factory.GUIController.CustomPropertiesEditor(props, propertyTypes);
}