المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to represent this type of data in a c# app?



C# Programming
09-13-2010, 03:23 AM
Hello coders,

I am new so please go easy http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif

OK, my application has a licensed state that is either 1)Valid 2)Trial 3)Invalid or 4)Expired

I will have an object (class) called license to handel this, along with the main form of my app.

Now I have a few questions.

1)How should I represent the available options?

Should I use enum licinse_state { trial, full etc

or simply set the property in the relevent function to a string
e.g

if(license is a full one)
string license_state = "FULL"
return license_state

2)What functions should go in the license class, what in the main form?

3) If I have a form to get the serial number, should this be called from my main form, then the serial number passed into my license class, or should I invoke the license class from my main form and then call the serial dialog from the license class?

Bit confused about what to put where, and what to call from what!

Thank you!