Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Packet Loss Pin
Member 114965274-Mar-15 4:59
Member 114965274-Mar-15 4:59 
GeneralRe: C# Packet Loss Pin
Gerry Schmitz4-Mar-15 11:57
mveGerry Schmitz4-Mar-15 11:57 
QuestionHow to import excel sheet data into postgresql database table in C# Pin
sandy reddy3-Mar-15 2:29
sandy reddy3-Mar-15 2:29 
AnswerRe: How to import excel sheet data into postgresql database table in C# Pin
manchanx3-Mar-15 2:38
professionalmanchanx3-Mar-15 2:38 
QuestionRe: How to import excel sheet data into postgresql database table in C# Pin
ZurdoDev3-Mar-15 2:46
professionalZurdoDev3-Mar-15 2:46 
AnswerRe: How to import excel sheet data into postgresql database table in C# Pin
V.3-Mar-15 20:19
professionalV.3-Mar-15 20:19 
QuestionDoes the .Net scheduled Timer has a vb version? Pin
PHdeviloth2-Mar-15 20:55
PHdeviloth2-Mar-15 20:55 
QuestionRe: Does the .Net scheduled Timer has a vb version? Pin
Richard MacCutchan2-Mar-15 21:25
mveRichard MacCutchan2-Mar-15 21:25 
AnswerRe: Does the .Net scheduled Timer has a vb version? Pin
F-ES Sitecore2-Mar-15 22:02
professionalF-ES Sitecore2-Mar-15 22:02 
AnswerRe: Does the .Net scheduled Timer has a vb version? Pin
ZurdoDev3-Mar-15 2:45
professionalZurdoDev3-Mar-15 2:45 
QuestionNeed help on FTPS file transmission using X509 Certificates Pin
Satheesh Kumar Subramanian2-Mar-15 18:03
Satheesh Kumar Subramanian2-Mar-15 18:03 
AnswerRe: Need help on FTPS file transmission using X509 Certificates Pin
Richard MacCutchan2-Mar-15 21:24
mveRichard MacCutchan2-Mar-15 21:24 
QuestionStreamReader in TcpListener Pin
Member 114922552-Mar-15 7:14
Member 114922552-Mar-15 7:14 
AnswerRe: StreamReader in TcpListener Pin
Paulo Zemek2-Mar-15 7:45
Paulo Zemek2-Mar-15 7:45 
GeneralRe: StreamReader in TcpListener Pin
Member 114922552-Mar-15 8:25
Member 114922552-Mar-15 8:25 
QuestionDatagridview row replay Pin
sdfsdfsdfewrew3feff1-Mar-15 5:03
sdfsdfsdfewrew3feff1-Mar-15 5:03 
GeneralRe: Datagridview row replay Pin
Richard MacCutchan1-Mar-15 6:15
mveRichard MacCutchan1-Mar-15 6:15 
GeneralRe: Datagridview row replay Pin
sdfsdfsdfewrew3feff1-Mar-15 8:23
sdfsdfsdfewrew3feff1-Mar-15 8:23 
GeneralRe: Datagridview row replay Pin
Richard MacCutchan1-Mar-15 22:38
mveRichard MacCutchan1-Mar-15 22:38 
GeneralRe: Datagridview row replay Pin
Eddy Vluggen2-Mar-15 8:02
professionalEddy Vluggen2-Mar-15 8:02 
Questioncreating a generic factory class that handles ValueTypes ? Pin
BillWoodruff28-Feb-15 23:36
professionalBillWoodruff28-Feb-15 23:36 
AnswerRe: creating a generic factory class that handles ValueTypes ? Pin
OriginalGriff1-Mar-15 0:11
mveOriginalGriff1-Mar-15 0:11 
You can constrain it to a value type by making the whole class generic and adding the struct constraint:
C#
public class VTBunchOLists<T> : List<IEnumerable<T>> where T : struct
    {
    private bool isInt;

    // 'ctor
    public VTBunchOLists()
        {
        isInt = typeof(T) == typeof(Int32);
        }
    ...
    }
(You have to use struct because ValueType isn't the root type for value types - it's just used for boxing)
And that might help a little - you can't use a where constraint on any sealed class (and all the primitives are sealed IIRC)

I have to say I don't like runtime type rejection in the constructor: I know what you mean, but it goes against my grain somewhat to force a run time error for something that should be a compile time problem! Laugh | :laugh:
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: creating a generic factory class that handles ValueTypes ? Pin
BillWoodruff1-Mar-15 1:23
professionalBillWoodruff1-Mar-15 1:23 
AnswerRe: creating a generic factory class that handles ValueTypes ? Pin
manchanx1-Mar-15 1:53
professionalmanchanx1-Mar-15 1:53 
GeneralRe: creating a generic factory class that handles ValueTypes ? Pin
BillWoodruff1-Mar-15 6:26
professionalBillWoodruff1-Mar-15 6:26 

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.