Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public interface IStartSession
{
void InvokeStartSesssionActions(ISession session);
void AddToStartSession(Action<ISession> action);
}
public class StartSession : IStartSession
{
private static readonly IList<Action<ISession>> StartSessionActions = new List<Action<ISession>>();
public void InvokeStartSesssionActions(ISession session)
{
foreach (var action in StartSessionActions)
{
action.Invoke(session);
}
}
public void AddToStartSession(Action<ISession> action)
{
StartSessionActions.Add(action);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.