Added functionality to create delegate for methods with value which pass by ref.