Click here to Skip to main content
16,003,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Time Difference Calculation In C# Pin
Peter_in_278012-Sep-10 18:22
professionalPeter_in_278012-Sep-10 18:22 
AnswerRe: Time Difference Calculation In C# Pin
Abhinav S12-Sep-10 18:25
Abhinav S12-Sep-10 18:25 
GeneralRe: Time Difference Calculation In C# Pin
Sanket.Patil12-Sep-10 19:33
Sanket.Patil12-Sep-10 19:33 
AnswerRe: Time Difference Calculation In C# Pin
Mycroft Holmes12-Sep-10 19:52
professionalMycroft Holmes12-Sep-10 19:52 
AnswerRe: Time Difference Calculation In C# Pin
J4amieC12-Sep-10 23:25
J4amieC12-Sep-10 23:25 
AnswerRe: Time Difference Calculation In C# Pin
Luc Pattyn13-Sep-10 2:36
sitebuilderLuc Pattyn13-Sep-10 2:36 
QuestionHow to represent this type of data in a c# app? Pin
stephen.darling12-Sep-10 11:37
stephen.darling12-Sep-10 11:37 
AnswerRe: How to represent this type of data in a c# app? Pin
Luc Pattyn12-Sep-10 11:57
sitebuilderLuc Pattyn12-Sep-10 11:57 
Hi
1.
yes, a limited number of possible values is exactly what enum is aiming at.
BTW: don't use strings for anything but text; if you are performing logic operations, use bools (not "true" and "false" strings); if you are counting, use integers (not "one", "two", "three" strings).

2.
it is good practice to separate actual things from user interaction things; the former are "business objects", the latter constitutes your GUI ("Graphical User Interface"). The properties, the logical expiration, the encryption, etc. that are associated with a license, all fit in a License class. Whatever you decide (now or later) to either look at a license, or to enter/edit license information, is completely separate from the license itself. You may end up having several products, all dealing with licenses based on one and the same License, but having different means to view and edit a License.

So design a License class, and a LicenseEntryForm class. The latter will use an instance of the former to store and operate on the license data.

3.
No, your License class should not hold any GUI stuff (see #2), it does not know the first thing about the user. For all it knows, the user may speak French or Vietnamese.

It is a bit confusing at first, you will get used to it.
You may have to read up on properties (don't make data members public!), possibly also on events and delegates.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


AnswerRe: How to represent this type of data in a c# app? Pin
Keith Barrow12-Sep-10 12:04
professionalKeith Barrow12-Sep-10 12:04 
AnswerRe: How to represent this type of data in a c# app? Pin
PIEBALDconsult12-Sep-10 12:36
mvePIEBALDconsult12-Sep-10 12:36 
GeneralRe: How to represent this type of data in a c# app? Pin
stephen.darling12-Sep-10 16:10
stephen.darling12-Sep-10 16:10 
GeneralRe: How to represent this type of data in a c# app? Pin
PIEBALDconsult12-Sep-10 16:22
mvePIEBALDconsult12-Sep-10 16:22 
QuestionTaking screenshots of PCs on LAN Pin
teknolog12312-Sep-10 8:50
teknolog12312-Sep-10 8:50 
AnswerRe: Taking screenshots of PCs on LAN Pin
OriginalGriff12-Sep-10 9:23
mveOriginalGriff12-Sep-10 9:23 
GeneralRe: Taking screenshots of PCs on LAN Pin
teknolog12312-Sep-10 9:29
teknolog12312-Sep-10 9:29 
GeneralRe: Taking screenshots of PCs on LAN Pin
OriginalGriff12-Sep-10 9:43
mveOriginalGriff12-Sep-10 9:43 
GeneralRe: Taking screenshots of PCs on LAN Pin
Eddy Vluggen12-Sep-10 9:53
professionalEddy Vluggen12-Sep-10 9:53 
AnswerRe: Taking screenshots of PCs on LAN Pin
Luc Pattyn12-Sep-10 9:53
sitebuilderLuc Pattyn12-Sep-10 9:53 
GeneralRe: Taking screenshots of PCs on LAN Pin
teknolog12312-Sep-10 10:04
teknolog12312-Sep-10 10:04 
GeneralRe: Taking screenshots of PCs on LAN Pin
Luc Pattyn12-Sep-10 10:12
sitebuilderLuc Pattyn12-Sep-10 10:12 
GeneralRe: Taking screenshots of PCs on LAN Pin
teknolog12312-Sep-10 10:15
teknolog12312-Sep-10 10:15 
GeneralRe: Taking screenshots of PCs on LAN Pin
Luc Pattyn12-Sep-10 10:18
sitebuilderLuc Pattyn12-Sep-10 10:18 
QuestionPainting on transparent background multiple times Pin
fdsfsa76f7sa612-Sep-10 1:47
fdsfsa76f7sa612-Sep-10 1:47 
AnswerRe: Painting on transparent background multiple times Pin
Abhishek Sur12-Sep-10 2:39
professionalAbhishek Sur12-Sep-10 2:39 
GeneralRe: Painting on transparent background multiple times Pin
fdsfsa76f7sa612-Sep-10 3:06
fdsfsa76f7sa612-Sep-10 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.