Ejemplo n.º 1
0
        //The reason this one takes multiple arguments is so it can field any relevant argument this prac can give.
        //It deviates from the one specified slightly but I couldn't think of how to do this without args as was shown in the handout. Discuss?
        private void OnUpdateEvent(NumericUpDown nud, ProgressBar progBar, TrackBar trackBar)
        {
            //Create a new custom event arg
               CustomEventArgs ce = new CustomEventArgs(nud, progBar, trackBar);

               //A bit of error-prevention as discussed in class
               if (progressEvent != null)
               {
               progressEvent(this, ce);
               }
        }
Ejemplo n.º 2
0
 //Abstract method that all child observers will provide implementation for
 public abstract void ProgUpdateHandler(object subject, CustomEventArgs ce);
Ejemplo n.º 3
0
 public override void ProgUpdateHandler(object subject, CustomEventArgs ce)
 {
     ce.trackBar.Value++;
 }
Ejemplo n.º 4
0
 public override void ProgUpdateHandler(object subject, CustomEventArgs ce)
 {
     ce.nud.UpButton();
     ce.nud.Refresh();
 }