private void SubscribeControls() { NumPub = new NumberPublisher(); //Subscribe controls to publisher event txtNumber.SubscribeToNumberPublisher(NumPub); trkChange.SubscribeToNumberPublisher(NumPub); }
//Subscribe delegate method NumberHasChanged to NumberPublisher's ValueChanged event public void SubscribeToNumberPublisher(NumberPublisher NumPub) { NumPub.ValueChanged += new NumberPublisher.ValueChangeHandler(NumberHasChanged); }