/// <summary> /// This protected virtual method raises the /// <see cref="IRequestComposition{TTarget}.CompositionRequested"/> /// event. /// </summary> /// <param name="participant">Optional parameter for a new /// <see cref="RequestCompositionEventArgs{TTarget}"/>: notice that if this is not null, /// the <paramref name="request"/> must be set..</param> /// <param name="request">Optional parameter for a new /// <see cref="RequestCompositionEventArgs{TTarget}"/>.</param> protected virtual void RaiseCompositionRequested( IComposerParticipant <ContainerConfiguration> participant = null, RequestCompositionEventArgs <ContainerConfiguration> .ParticipantRequest request = RequestCompositionEventArgs <ContainerConfiguration> .ParticipantRequest.None) => CompositionRequested?.Invoke( this, participant != null ? new RequestCompositionEventArgs <ContainerConfiguration>(participant, request) : new RequestCompositionEventArgs <ContainerConfiguration>());
/// <summary> /// Raises this <see cref="CompositionRequested"/> event with the given /// <paramref name="participantEvent"/>. Note that this method is invoked by /// <see cref="HandleParticipantCompositionRequested"/>, which will invoke this /// with the actual event raised by a participant added here; and such an /// event also has the optional callback from the participant. /// </summary> /// <param name="participantEvent">An event raised by the participant here; /// or, any new event to raise now.</param> protected virtual void RaiseCompositionRequested(RequestCompositionEventArgs <TTarget> participantEvent) { lock (Participants) { if (isDisposed) { return; } } CompositionRequested?.Invoke(this, participantEvent); }
private void requestComposition(RequestCompositionEventArgs <TTarget> eventArgs) => CompositionRequested?.Invoke(this, eventArgs);
private void handleCompositionRequested(object sender, RequestCompositionEventArgs <TTarget> eventArgs) => CompositionRequested?.Invoke(this, eventArgs);