//sets subject, button, random object
public Observer(SubjectWithEvent subject, String observerName, Button buttonToClick, Random random)
{
this.subject = subject;
this.observerName = observerName;
this.random = random;
buttonString = buttonToClick.ToString();
//adds delegate instance containing "DoStuff" to the buttons click event
buttonToClick.Click += new System.EventHandler(DoStuff);
}