Rewriting GetContext procedure on mono

@amoiseev-softheme FYI
Very familiar peace of code... :trollface: