public static VMObject CallContext(this IRuntime runtime, string contextName, ContractMethod method, params object[] args) { runtime.Expect(method != null, "trying to call null method for context: " + contextName); NativeContractKind nativeKind; if (Enum.TryParse <NativeContractKind>(contextName, true, out nativeKind)) { return(runtime.CallContext(contextName, 0, method.name, args)); } runtime.Expect(method.offset >= 0, "invalid offset for method: " + method.name); return(runtime.CallContext(contextName, (uint)method.offset, method.name, args)); }