コード例 #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);
               }
        }
コード例 #2
0
 //Abstract method that all child observers will provide implementation for
 public abstract void ProgUpdateHandler(object subject, CustomEventArgs ce);
コード例 #3
0
 public override void ProgUpdateHandler(object subject, CustomEventArgs ce)
 {
     ce.trackBar.Value++;
 }
コード例 #4
0
ファイル: NUDObserver.cs プロジェクト: dec-k/IN710-keigdl1
 public override void ProgUpdateHandler(object subject, CustomEventArgs ce)
 {
     ce.nud.UpButton();
     ce.nud.Refresh();
 }