Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: Track two types of values within one variable Pin
SledgeHammer0127-Jul-12 6:28
SledgeHammer0127-Jul-12 6:28 
GeneralRe: Track two types of values within one variable Pin
hpjchobbes27-Jul-12 7:04
hpjchobbes27-Jul-12 7:04 
GeneralMessage Removed Pin
27-Jul-12 6:38
professionalN_tro_P27-Jul-12 6:38 
GeneralRe: Track two types of values within one variable Pin
hpjchobbes27-Jul-12 7:18
hpjchobbes27-Jul-12 7:18 
GeneralRe: Track two types of values within one variable Pin
BillWoodruff29-Jul-12 18:35
professionalBillWoodruff29-Jul-12 18:35 
GeneralRe: Track two types of values within one variable Pin
SledgeHammer0127-Jul-12 11:40
SledgeHammer0127-Jul-12 11:40 
GeneralMessage Removed Pin
27-Jul-12 12:22
professionalN_tro_P27-Jul-12 12:22 
GeneralRe: Track two types of values within one variable Pin
SledgeHammer0127-Jul-12 12:33
SledgeHammer0127-Jul-12 12:33 
Collin Jasnoch wrote:
Because he has not stated his reason for layers but is trying to use it. That is
the point.


He did. He wanted to be able to tell the difference between a % and a $ amount. In which case an enum (or even a bool would suffice).


Collin Jasnoch wrote:
I have seen cases where an empty interface is even used. It is not over
engineering. It is creating a base API.
 

By what the OP was an
interface is exactly what should be used.


OP wanted to have a single double that held 2 different types of values and wanted to know a way to tell the difference between them. Using his GetType() solution required having 3 classes. The enum solution requires an enum & a single class.

I'm not against interfaces, I use them all the time. I don't do stuff just cuz I can, I do stuff when its appropriate. I could also wear a tuxedo to go to Burger King, but I don't cuz that's slightly overkill Smile | :) .
AnswerRe: Track two types of values within one variable Pin
Eddy Vluggen27-Jul-12 7:13
professionalEddy Vluggen27-Jul-12 7:13 
GeneralRe: Track two types of values within one variable Pin
hpjchobbes27-Jul-12 7:23
hpjchobbes27-Jul-12 7:23 
GeneralRe: Track two types of values within one variable Pin
Eddy Vluggen27-Jul-12 8:24
professionalEddy Vluggen27-Jul-12 8:24 
GeneralRe: Track two types of values within one variable Pin
PIEBALDconsult27-Jul-12 8:15
mvePIEBALDconsult27-Jul-12 8:15 
AnswerRe: Track two types of values within one variable Pin
SledgeHammer0127-Jul-12 11:45
SledgeHammer0127-Jul-12 11:45 
GeneralRe: Track two types of values within one variable Pin
jschell27-Jul-12 11:57
jschell27-Jul-12 11:57 
GeneralRe: Track two types of values within one variable Pin
Paul Conrad28-Jul-12 9:31
professionalPaul Conrad28-Jul-12 9:31 
GeneralMessage Removed Pin
27-Jul-12 12:24
professionalN_tro_P27-Jul-12 12:24 
GeneralRe: Track two types of values within one variable Pin
SledgeHammer0127-Jul-12 12:36
SledgeHammer0127-Jul-12 12:36 
GeneralMessage Removed Pin
27-Jul-12 13:52
professionalN_tro_P27-Jul-12 13:52 
GeneralRe: Track two types of values within one variable Pin
jschell28-Jul-12 6:33
jschell28-Jul-12 6:33 
AnswerRe: Track two types of values within one variable Pin
Trak4Net27-Jul-12 18:26
Trak4Net27-Jul-12 18:26 
GeneralRe: Track two types of values within one variable Pin
Paul Conrad28-Jul-12 9:32
professionalPaul Conrad28-Jul-12 9:32 
AnswerRe: Track two types of values within one variable Pin
Northcodedotno29-Jul-12 8:36
Northcodedotno29-Jul-12 8:36 
AnswerRe: Track two types of values within one variable Pin
BobJanova29-Jul-12 23:16
BobJanova29-Jul-12 23:16 
GeneralAdding databound ComboBox into cells of a DataGridView Pin
Dewald27-Jul-12 2:11
Dewald27-Jul-12 2:11 
QuestionHow to make GRIDVIEW as Rounded Corners Pin
mukusingh27-Jul-12 0:33
mukusingh27-Jul-12 0:33 

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.