Click here to Skip to main content
15,882,163 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# creating my own class that acts like a string Pin
harold aptroot21-Jun-14 5:35
harold aptroot21-Jun-14 5:35 
GeneralRe: C# creating my own class that acts like a string Pin
hpjchobbes21-Jun-14 17:20
hpjchobbes21-Jun-14 17:20 
GeneralRe: C# creating my own class that acts like a string Pin
harold aptroot21-Jun-14 20:25
harold aptroot21-Jun-14 20:25 
GeneralRe: C# creating my own class that acts like a string Pin
OriginalGriff21-Jun-14 20:29
mveOriginalGriff21-Jun-14 20:29 
GeneralRe: C# creating my own class that acts like a string Pin
hpjchobbes22-Jun-14 7:24
hpjchobbes22-Jun-14 7:24 
GeneralRe: C# creating my own class that acts like a string Pin
harold aptroot22-Jun-14 7:29
harold aptroot22-Jun-14 7:29 
GeneralRe: C# creating my own class that acts like a string Pin
hpjchobbes22-Jun-14 9:52
hpjchobbes22-Jun-14 9:52 
AnswerRe: C# creating my own class that acts like a string Pin
BobJanova23-Jun-14 1:26
BobJanova23-Jun-14 1:26 
I'm not quite sure what you're trying to achieve here. I think it is that you want a data object that has a 'number' (a string identifier) and also a type. Using GetType or is/as functions is generally a sign that you haven't quite got the solution you want; switching based on type usually implies you need more polymorphic behaviour.

I think the better solution is
enum ItemType { Serial, Lot };
struct ObjectIdentifier {
 string Identity { get; set; }
 ItemType Type { get; set; }
}

List<ObjectIdentifier> mySLNList = ...;

foreach(ObjectIdentifier oi in mySLNList)
 switch(oi.Type)
  ...

Questionplease recommend a book for beginner Pin
solo920-Jun-14 13:10
solo920-Jun-14 13:10 
AnswerRe: please recommend a book for beginner Pin
Peter Leow20-Jun-14 16:12
professionalPeter Leow20-Jun-14 16:12 
GeneralRe: please recommend a book for beginner Pin
solo920-Jun-14 16:23
solo920-Jun-14 16:23 
GeneralRe: please recommend a book for beginner Pin
Peter Leow20-Jun-14 16:36
professionalPeter Leow20-Jun-14 16:36 
AnswerRe: please recommend a book for beginner Pin
OriginalGriff20-Jun-14 19:03
mveOriginalGriff20-Jun-14 19:03 
GeneralRe: please recommend a book for beginner Pin
solo921-Jun-14 1:44
solo921-Jun-14 1:44 
GeneralRe: please recommend a book for beginner Pin
harold aptroot21-Jun-14 2:06
harold aptroot21-Jun-14 2:06 
GeneralRe: please recommend a book for beginner Pin
OriginalGriff21-Jun-14 2:26
mveOriginalGriff21-Jun-14 2:26 
GeneralRe: please recommend a book for beginner Pin
solo921-Jun-14 11:29
solo921-Jun-14 11:29 
QuestionProblem with get() method! Pin
LAPEC20-Jun-14 7:07
LAPEC20-Jun-14 7:07 
AnswerRe: Problem with get() method! Pin
Eddy Vluggen20-Jun-14 7:59
professionalEddy Vluggen20-Jun-14 7:59 
GeneralRe: Problem with get() method! Pin
LAPEC20-Jun-14 8:14
LAPEC20-Jun-14 8:14 
GeneralRe: Problem with get() method! Pin
Eddy Vluggen20-Jun-14 8:36
professionalEddy Vluggen20-Jun-14 8:36 
GeneralRe: Problem with get() method! Pin
LAPEC20-Jun-14 8:43
LAPEC20-Jun-14 8:43 
GeneralRe: Problem with get() method! Pin
LAPEC20-Jun-14 8:46
LAPEC20-Jun-14 8:46 
GeneralRe: Problem with get() method! Pin
Eddy Vluggen20-Jun-14 9:01
professionalEddy Vluggen20-Jun-14 9:01 
GeneralRe: Problem with get() method! Pin
LAPEC20-Jun-14 9:05
LAPEC20-Jun-14 9:05 

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.