Click here to Skip to main content
15,847,583 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dynamic connector between two draw objects in canvas Pin
BobJanova23-Jun-14 2:27
BobJanova23-Jun-14 2:27 
Questionunable to connect to any of the specified mysql Pin
Jassim Rahma21-Jun-14 23:15
Jassim Rahma21-Jun-14 23:15 
AnswerRe: unable to connect to any of the specified mysql Pin
Pete O'Hanlon22-Jun-14 0:19
subeditorPete O'Hanlon22-Jun-14 0:19 
GeneralRe: unable to connect to any of the specified mysql Pin
Jassim Rahma22-Jun-14 0:41
Jassim Rahma22-Jun-14 0:41 
AnswerRe: unable to connect to any of the specified mysql Pin
Bernhard Hiller22-Jun-14 22:55
Bernhard Hiller22-Jun-14 22:55 
GeneralRe: unable to connect to any of the specified mysql Pin
Jassim Rahma22-Jun-14 23:00
Jassim Rahma22-Jun-14 23:00 
AnswerRe: unable to connect to any of the specified mysql Pin
Eddy Vluggen23-Jun-14 1:25
professionalEddy Vluggen23-Jun-14 1:25 
QuestionC# creating my own class that acts like a string Pin
hpjchobbes21-Jun-14 6:23
hpjchobbes21-Jun-14 6:23 
I am trying to create some classes that act like a string, but allow me to test the type at a later date. Because string and String are sealed, I can't seem to inherit from them. I also found out you can't override the assignment operator. I found something close to what I want here on stackoverflow, but it uses structs which can't be inherited. Here's a example of what I want to do, but I can't figure out how:
C#
public class ORSerialLotNumber : string {}
public class SerialNumber : ORSerialLotNumber {}
public class LotNumber : ORSerialLotNumber {}

// ......

List<ORSerialLotNumber> mySLNList = new List<ORSerialLotNumber>();
SerialNumber sNum1 = "Sd-23s-3sf";
LotNumber nNum1 = "2342434";

mySLNList.Add(sNum1);
mySLNList.Add(nNum1);

// ......

foreach(var v in mySLNList)
    if(v.GetType() == typeof(SerialNumber))
        string serial = v;
    if(v.GetType() == typeof(LotNumber))
        string lot = v;

GeneralRe: C# creating my own class that acts like a string Pin
harold aptroot21-Jun-14 6:35
harold aptroot21-Jun-14 6:35 
GeneralRe: C# creating my own class that acts like a string Pin
hpjchobbes21-Jun-14 18:20
hpjchobbes21-Jun-14 18:20 
GeneralRe: C# creating my own class that acts like a string Pin
harold aptroot21-Jun-14 21:25
harold aptroot21-Jun-14 21:25 
GeneralRe: C# creating my own class that acts like a string Pin
OriginalGriff21-Jun-14 21:29
mveOriginalGriff21-Jun-14 21:29 
GeneralRe: C# creating my own class that acts like a string Pin
hpjchobbes22-Jun-14 8:24
hpjchobbes22-Jun-14 8:24 
GeneralRe: C# creating my own class that acts like a string Pin
harold aptroot22-Jun-14 8:29
harold aptroot22-Jun-14 8:29 
GeneralRe: C# creating my own class that acts like a string Pin
hpjchobbes22-Jun-14 10:52
hpjchobbes22-Jun-14 10:52 
AnswerRe: C# creating my own class that acts like a string Pin
BobJanova23-Jun-14 2:26
BobJanova23-Jun-14 2:26 
Questionplease recommend a book for beginner Pin
solo920-Jun-14 14:10
solo920-Jun-14 14:10 
AnswerRe: please recommend a book for beginner Pin
Peter Leow20-Jun-14 17:12
professionalPeter Leow20-Jun-14 17:12 
GeneralRe: please recommend a book for beginner Pin
solo920-Jun-14 17:23
solo920-Jun-14 17:23 
GeneralRe: please recommend a book for beginner Pin
Peter Leow20-Jun-14 17:36
professionalPeter Leow20-Jun-14 17:36 
AnswerRe: please recommend a book for beginner Pin
OriginalGriff20-Jun-14 20:03
mveOriginalGriff20-Jun-14 20:03 
GeneralRe: please recommend a book for beginner Pin
solo921-Jun-14 2:44
solo921-Jun-14 2:44 
GeneralRe: please recommend a book for beginner Pin
harold aptroot21-Jun-14 3:06
harold aptroot21-Jun-14 3:06 
GeneralRe: please recommend a book for beginner Pin
OriginalGriff21-Jun-14 3:26
mveOriginalGriff21-Jun-14 3:26 
GeneralRe: please recommend a book for beginner Pin
solo921-Jun-14 12:29
solo921-Jun-14 12:29 

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.