I have currently an application that have various forms that are basically about scanning some barcode/RFID tags and displays the List.
As such I have some generics components and even a generic sub forms used by others forms.
Basically this form contains :
- A top bar with some labels about how many objects were scanned
- A customized ListView in the center
- A bottom bar with a "cancel" and "save" button.
Currently this forms take in his constructors two delegates, each of them is called when clicking to the corresponding button in the bottom of the form.
By doing that, I'm entirely delegating the cancel/save action and the closing of the current form to the parent form. Note that the condition for the save button to close the form and save the data change depending of the caller.
This application is basically my first step onto the C# world. I know about events
and use them in others part of my application but it doesn't seems to match this specific requirments. However since I didn't/Read a lot about C# I am not sure about the approach that I choosed, but obvisouly that deson't seems the standard way of doing it.
So here is my question :
- Does using delegates instead of events for this specific requirment is how it should be handled ?
- At a higher level, is my design about the generic forms called from many specific form good or did I miss something ?
Note :I have very specific constraint : it is for embedded devie with compact framework (a subset of classic NET 3.5 Framework where I don't have all the classes and the available classes don't have all their classic methods/attributes available).