devexpress objectspace to session

C#
(objectSpace as XPObjectSpace).Session
Source

Also in C#: