RhinoDoc How to?

Where to I get the RhinoDoc object ?
There is no method in RhinoApp and after a hour I am unable to find how to reference the current
Document.
Making a C# component from grasshopper
Something simple but unable to find it

http://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_RhinoDoc_ActiveDoc.htm

Note the warning…