# MessageDelegate delegate

Namespace: [Grasshopper2.Doc](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.doc.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public delegate MessageDelegate
```

A delegate for errors and warnings to invoke when they are clicked. Provide naming overrides and detailed information by attached the [UiNameAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.uinameattribute.md) and [UiInfoAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.uiinfoattribute.md) attributes to your method.

**Signature:**

```cs
void MessageDelegate(IDocumentObject obj, Message message)
```

**Parameters:**

- `obj` ([IDocumentObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.idocumentobject.md)): Document object which spawned the message.
- `message` ([Message](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.message.md)): Message associated with this action.
