1.Create a class called Person.
Person has the following read only attributes:
2.Create a class called YourQueue which inherits the functionality of the .Net Queue collection class.
3.Override the functionality of the Dequeue() method as follows:
4.In the Form1_Load() method of your form:
A.Create the following people objects: see image.
B.Declare and instantiate a variable of type YourQueue called MyPeople:
YourQueue MyPeople = new YourQueue();
C.Subscribe to the NonPersonDequeued event.
Provide a Message Box in the MyPeople_NonPersonDequeued() method to display as follows (red box indicates place holder where information obtained from the Object is to be displayed): see image.
D.Subscribe to the PersonDequeued event.
Provide a Message Box in the MyPeople_PersonDequeued() method to display as follows (red box indicates place holder where information obtained from the Person is to be displayed): see image.
E.Enqueue your 3 people from above!
F.Also Enqueue "Mickey Mouse" (not a Person)
G.Call MyPeople.Dequeue() 4 times.
Output: see image.