protected virtual void OnRaiseSelectedLibraryChangedEvent(SelectedLibraryChangedEventArgs slcea) { // Make a temporary copy of the event to avoid possibility of // a race condition if the last subscriber unsubscribes // immediately after the null check and before the event is raised. SelectedLibraryChangedEventHandler handler = SelectedLibraryChangedEvent; // Raise the event if (handler != null) { handler(this, slcea); } }
void HandleSelectedLibraryChangedEvent(object sender, SelectedLibraryChangedEventArgs slcea) { selectedLibrary = slcea.SelectedLibrary; playlistEditorControl.SelectedLibrary = selectedLibrary; playerControl.SelectedLibrary = selectedLibrary; }
protected virtual void OnRaiseSelectedLibraryChangedEvent(SelectedLibraryChangedEventArgs slcea) { // Make a temporary copy of the event to avoid possibility of // a race condition if the last subscriber unsubscribes // immediately after the null check and before the event is raised. SelectedLibraryChangedEventHandler handler = SelectedLibraryChangedEvent; // Raise the event if (handler != null) handler(this, slcea); }