Delegate.Combine 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 결합할 수 있는 멀티캐스트 대리자의 호출 목록을 연결합니다.
오버로드
Combine(Delegate[]) |
대리자 배열의 호출 목록을 연결합니다. |
Combine(Delegate, Delegate) |
두 대리자의 호출 목록을 연결합니다. |
Combine(Delegate[])
대리자 배열의 호출 목록을 연결합니다.
public:
static Delegate ^ Combine(... cli::array <Delegate ^> ^ delegates);
public:
static Delegate ^ Combine(cli::array <Delegate ^> ^ delegates);
public static Delegate Combine (params Delegate[] delegates);
public static Delegate? Combine (params Delegate?[]? delegates);
public static Delegate Combine (Delegate[] delegates);
[System.Runtime.InteropServices.ComVisible(true)]
public static Delegate Combine (params Delegate[] delegates);
static member Combine : Delegate[] -> Delegate
[<System.Runtime.InteropServices.ComVisible(true)>]
static member Combine : Delegate[] -> Delegate
Public Shared Function Combine (ParamArray delegates As Delegate()) As Delegate
Public Shared Function Combine (delegates As Delegate()) As Delegate
매개 변수
- delegates
- Delegate[]
결합할 대리자의 배열입니다.
반환
delegates
배열의 대리자 호출 목록을 연결하는 호출 목록이 있는 새 대리자입니다. delegates
가 null
이거나 delegates
에 요소가 없거나 delegates
의 모든 항목이 null
인 경우 null
을 반환합니다.
- 특성
예외
delegates
의 null이 아닌 모든 항목이 동일한 대리자 형식의 인스턴스인 것은 아닙니다.
설명
배열에 delegates
항목이 null
포함된 경우 해당 항목은 무시됩니다.
호출 목록에 중복 항목이 포함될 수 있습니다. 즉, 동일한 개체에서 동일한 메서드를 참조하는 항목입니다.
참고
분산으로 인해 할당 호환되는 제네릭 대리자는 반드시 결합할 수 있는 것은 아닙니다. 결합 가능하려면 형식이 정확히 일치해야 합니다. 예를 들어 명명된 클래스가 명명 Derived
Base
된 클래스에서 파생되었다고 가정합니다. 공변성 및 반공변성에서 설명한 대로 형식 Action<Base>
의 대리자(Action(Of Base)
Visual Basic)를 형식 Action<Derived>
변수에 할당할 수 있지만 형식이 정확히 일치하지 않으므로 두 대리자를 결합할 수 없습니다.
Combine 는 이벤트가 발생할 때마다 여러 메서드를 호출하는 이벤트 처리기를 만드는 데 유용합니다.
추가 정보
적용 대상
Combine(Delegate, Delegate)
두 대리자의 호출 목록을 연결합니다.
public:
static Delegate ^ Combine(Delegate ^ a, Delegate ^ b);
public static Delegate Combine (Delegate a, Delegate b);
public static Delegate? Combine (Delegate? a, Delegate? b);
static member Combine : Delegate * Delegate -> Delegate
Public Shared Function Combine (a As Delegate, b As Delegate) As Delegate
매개 변수
- a
- Delegate
해당 호출 목록이 처음에 나오는 대리자입니다.
- b
- Delegate
해당 호출 목록이 마지막에 나오는 대리자입니다.
반환
호출 목록 a
와 b
를 순서대로 연결하는 호출 목록을 가진 새 대리자입니다. b
가 null
이면 a
를 반환하고, a
가 null 참조이면 b
를 반환하며, a
와 b
가 모두 null 참조이면 null 참조를 반환합니다.
예외
a
및 b
모두 null
이 아니며, a
및 b
가 동일한 대리자 형식의 인스턴스가 아닙니다.
설명
호출 목록에 중복 항목이 포함될 수 있습니다. 즉, 동일한 개체에서 동일한 메서드를 참조하는 항목입니다.
참고
분산으로 인해 할당 호환되는 제네릭 대리자는 반드시 결합할 수 있는 것은 아닙니다. 결합 가능하려면 형식이 정확히 일치해야 합니다. 예를 들어 명명된 클래스가 명명 Derived
Base
된 클래스에서 파생되었다고 가정합니다. 공변성 및 반공변성에서 설명한 대로 형식 Action<Base>
의 대리자(Action(Of Base)
Visual Basic)를 형식 Action<Derived>
변수에 할당할 수 있지만 형식이 정확히 일치하지 않으므로 두 대리자를 결합할 수 없습니다.
Combine 는 이벤트가 발생할 때마다 여러 메서드를 호출하는 이벤트 처리기를 만드는 데 유용합니다.