using System.Collections.Generic;
using System.Collections.ObjectModel;
public class MyClass: MyInterface
this.ReceivedNewObjects += SaveNewObjects;
public ICollection<Object> GetNewObjects()
var newObjects = new Collection<Object>();
OnReceivingNewObjects(newObjects);
return new Collection<Object>();
private void SaveNewObjects(object sender, ICollection<Object> newObjects)
public event EventHandler<ICollection<Object>> ReceivedNewObjects;
protected virtual void OnReceivingNewObjects(ICollection<Object> newObjects)
ReceivedNewObjects?.Invoke(this, newObjects);
public interface MyInterface
ICollection<Object> GetNewObjects();
event EventHandler<ICollection<Object>> ReceivedNewObjects;