protected virtual void OnRaiseProductVisibilityChangedEvent(IEnumerable <IIfcProduct> products) { // 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. ProductVisibilityChangedEventHandler handler = ProductVisibilityChanged; // Event will be null if there are no subscribers if (handler != null) { //create argument ProductVisibilityChangedEventArgs e = new ProductVisibilityChangedEventArgs(products); // Use the () operator to raise the event. handler(this, e); } }
protected virtual void OnRaiseProductVisibilityChangedEvent(IEnumerable<IfcProduct> products) { // 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. ProductVisibilityChangedEventHandler handler = ProductVisibilityChanged; // Event will be null if there are no subscribers if (handler != null) { //create argument ProductVisibilityChangedEventArgs e = new ProductVisibilityChangedEventArgs(products); // Use the () operator to raise the event. handler(this, e); } }