Class ExternalCallRequest
One call to something that is not the workspace's own code: a standard-library member, a referenced
library's, a host application's object model, or a native export a Declare named.
public sealed record ExternalCallRequest : IEquatable<ExternalCallRequest>
- Inheritance
-
ExternalCallRequest
- Implements
- Inherited Members
Remarks
A growable record rather than a parameter list, so a new fact about a call — the policy decision that let it through, the reference it came from — gets a field here rather than a new parameter on every dispatcher.
Constructors
ExternalCallRequest(VBTypeMemberSymbol, IRuntimeValue[], SourceLocation)
One call to something that is not the workspace's own code: a standard-library member, a referenced
library's, a host application's object model, or a native export a Declare named.
public ExternalCallRequest(VBTypeMemberSymbol Member, IRuntimeValue[] Arguments, SourceLocation CallSite = default)
Parameters
MemberVBTypeMemberSymbolThe member being called. Its ExternalTarget is what says which implementation to reach, and its own parameters say how to marshal the arguments.
ArgumentsIRuntimeValue[]The arguments, in the member's declared parameter order, including the receiver at index
0for a member of a class — the same shape Invoke(VBTypeMemberSymbol, ISymbolResolver, IRuntimeValue[]) takes, so a call site does not have to know which of the two will run it.CallSiteSourceLocationWhere the call is written. An external member that raises an error cannot know this for itself, and an error with no location is one no editor can point at.
Remarks
A growable record rather than a parameter list, so a new fact about a call — the policy decision that let it through, the reference it came from — gets a field here rather than a new parameter on every dispatcher.
Properties
Arguments
The arguments, in the member's declared parameter order, including the receiver at index
0 for a member of a class — the same shape Invoke(VBTypeMemberSymbol, ISymbolResolver, IRuntimeValue[]) takes, so a
call site does not have to know which of the two will run it.
public IRuntimeValue[] Arguments { get; init; }
Property Value
CallSite
Where the call is written. An external member that raises an error cannot know this for itself, and an error with no location is one no editor can point at.
public SourceLocation CallSite { get; init; }
Property Value
IsLibraryImport
Whether this call is to a native library a Declare named — the calls an administrator most
wants a say over, since a library call is a way to run arbitrary code.
public bool IsLibraryImport { get; }
Property Value
Library
The library a Declare named, or null for a call that is not one.
public string? Library { get; }
Property Value
Member
The member being called. Its ExternalTarget is what says which implementation to reach, and its own parameters say how to marshal the arguments.
public VBTypeMemberSymbol Member { get; init; }
Property Value
Methods
Describe()
The call as one line, arguments included: what an interceptor logs, and what the verbose half of a refusal has to say so that a reader can tell which call was refused.
public string Describe()
Returns
Remarks
Names the library and the entry point a Declare actually reaches — its Alias when it has
one, since that is the exported name and the VBA name may be nothing like it.