ParameterModifier 구조체

정의

바인딩이 형식이 수정된 매개 변수 서명에서 작동되도록 매개 변수에 한정자를 연결합니다.

public value class ParameterModifier
public readonly struct ParameterModifier
public struct ParameterModifier
[System.Serializable]
public struct ParameterModifier
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct ParameterModifier
type ParameterModifier = struct
[<System.Serializable>]
type ParameterModifier = struct
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ParameterModifier = struct
Public Structure ParameterModifier
상속
ParameterModifier
특성

예제

다음 코드 예제에서는 세 개의 문자열 인수가 있는 멤버에 대해 이 값을 보여 하며, 그 중 첫 번째 및 세 번째는 참조로 전달됩니다. 명명 obj 된 변수에 COM 개체에 대한 참조가 포함되어 있다고 가정합니다.

// Create an array containing the arguments.
array<Object^>^ args = {"Argument 1", "Argument 2", "Argument 3" };

// Initialize a ParameterModifier with the number of parameters.
ParameterModifier p = ParameterModifier(3);

// Pass the first and third parameters by reference.
p[0] = true;
p[2] = true;

// The ParameterModifier must be passed as the single element
// of an array.

array<ParameterModifier>^ mods = { p };

// Invoke the method late bound.
obj->GetType()->InvokeMember("MethodName", BindingFlags::InvokeMethod,
     nullptr, obj, args, mods, nullptr, nullptr);
// Create an array containing the arguments.
object[] args = {"Argument 1", "Argument 2", "Argument 3" };

// Initialize a ParameterModifier with the number of parameters.
ParameterModifier p = new ParameterModifier(3);

// Pass the first and third parameters by reference.
p[0] = true;
p[2] = true;

// The ParameterModifier must be passed as the single element
// of an array.
ParameterModifier[] mods = { p };

// Invoke the method late bound.
obj.GetType().InvokeMember("MethodName", BindingFlags.InvokeMethod,
     null, obj, args, mods, null, null);
' Create an array containing the arguments.
Dim args As Object = {"Argument 1", "Argument 2", "Argument 3" }

' Initialize a ParameterModifier with the number of parameters.
Dim p As New ParameterModifier(3)

' Pass the first and third parameters by reference.
p(0) = True
p(2) = True

' The ParameterModifier must be passed as the single element
' of an array.
Dim mods() As ParameterModifier = { p }

' Invoke the method late bound.
obj.GetType().InvokeMember("MethodName", BindingFlags.InvokeMethod, _
     Nothing, obj, args, mods, Nothing, Nothing)

설명

구조는 ParameterModifier 늦게 바인딩된 COM 구성 요소에 대한 참조로 매개 변수를 전달할 때 메서드 오버로드와 함께 Type.InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]) 사용됩니다. 참조로 전달되어야 하는 매개 변수는 단일 ParameterModifier 구조체에 의해 지정되며, 단일 요소를 포함하는 배열에 전달되어야 합니다. 이 배열의 단일 ParameterModifier 구조체는 호출할 멤버의 매개 변수 수를 사용하여 초기화해야 합니다. 이러한 매개 변수 중 참조로 전달되는 매개 변수를 나타내려면 속성 값(C#의 Item[] 인덱서) true 을 매개 변수의 0부터 시작하는 위치에 해당하는 인덱스 번호로 설정합니다.

생성자

ParameterModifier(Int32)

지정된 수의 매개 변수를 나타내는 ParameterModifier 구조체의 새 인스턴스를 초기화합니다.

속성

Item[Int32]

지정된 인덱스 위치에 있는 매개 변수가 현재 ParameterModifier에 의해 수정될 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

적용 대상