Click here to Skip to main content
15,895,192 members
Home / Discussions / C#
   

C#

 
AnswerRe: the efficieny consideration Pin
Ennis Ray Lynch, Jr.21-Nov-08 3:34
Ennis Ray Lynch, Jr.21-Nov-08 3:34 
QuestionForm Paint drawing incorrectly Pin
Chris Copeland21-Nov-08 3:14
mveChris Copeland21-Nov-08 3:14 
AnswerRe: Form Paint drawing incorrectly Pin
Ennis Ray Lynch, Jr.21-Nov-08 3:35
Ennis Ray Lynch, Jr.21-Nov-08 3:35 
GeneralRe: Form Paint drawing incorrectly Pin
Chris Copeland21-Nov-08 3:49
mveChris Copeland21-Nov-08 3:49 
GeneralRe: Form Paint drawing incorrectly Pin
Ennis Ray Lynch, Jr.21-Nov-08 3:57
Ennis Ray Lynch, Jr.21-Nov-08 3:57 
GeneralRe: Form Paint drawing incorrectly Pin
Chris Copeland21-Nov-08 4:07
mveChris Copeland21-Nov-08 4:07 
GeneralRe: Form Paint drawing incorrectly Pin
Guffa21-Nov-08 5:01
Guffa21-Nov-08 5:01 
QuestionGeneric Class with Inheritance Pin
MatthysDT21-Nov-08 2:50
MatthysDT21-Nov-08 2:50 
I have a generic class which I use to populate a BindingList which I then use as the DataSource of my DataGridView.

This class inherits from my LINQ table and adds some extra properties such as State etc...
The problem is that I have to creat a new class for every single LINQ table I choose to use this way, I need some way to make my inheritance generic.

This code works for that specific class (but it's not really generic since it only works for "myExampleTable"):
Please not that <<T>> is only written with double brackets because the correct syntax doesn't want to display in CP.
namespace BL.CustomLINQ {

    public class StateTracker<<T>> : myExampleTable where T:class  {
        public enum ErrorState {
            NoError = 0,
            RowIsIncomplete = 1,
            RowValidationFailed = 2
        }
        public int state{get;set;}
        public ErrorState RowErrorState { get; set; }
        public StateTracker() : base() { }
    }
}
But as I said, this code is useless for me!



This is what I really want to do, but I'm doing it wrong:

namespace BL.CustomLINQ {

    public class StateTracker<<T>> : T where T:class  {
        public enum ErrorState {
            NoError = 0,
            RowIsIncomplete = 1,
            RowValidationFailed = 2
        }
        public int state{get;set;}
        public ErrorState RowErrorState { get; set; }
        public StateTracker() : base() { }
    }
}
Note that I'm inheriting from the same class as the one I passed in as the generic.
The error I get (underlining T) is: Cannot derive from 'T' because it is a type parameter.

Is there any way to do this or should I try a different (less appealing ) approach?
AnswerRe: Generic Class with Inheritance Pin
cor287921-Nov-08 13:41
cor287921-Nov-08 13:41 
AnswerRe: Generic Class with Inheritance Pin
N a v a n e e t h21-Nov-08 17:33
N a v a n e e t h21-Nov-08 17:33 
GeneralRe: Generic Class with Inheritance Pin
MatthysDT23-Nov-08 19:23
MatthysDT23-Nov-08 19:23 
GeneralRe: Generic Class with Inheritance Pin
cor287924-Nov-08 4:05
cor287924-Nov-08 4:05 
GeneralRe: Generic Class with Inheritance Pin
MatthysDT24-Nov-08 19:11
MatthysDT24-Nov-08 19:11 
QuestionParent form Text Pin
pcjd6321-Nov-08 2:45
pcjd6321-Nov-08 2:45 
AnswerRe: Parent form Text Pin
Pedram Behroozi21-Nov-08 4:57
Pedram Behroozi21-Nov-08 4:57 
GeneralRe: Parent form Text Pin
pcjd6321-Nov-08 5:07
pcjd6321-Nov-08 5:07 
GeneralRe: Parent form Text Pin
pcjd6321-Nov-08 5:18
pcjd6321-Nov-08 5:18 
GeneralRe: Parent form Text Pin
Pedram Behroozi21-Nov-08 5:26
Pedram Behroozi21-Nov-08 5:26 
GeneralRe: Parent form Text Pin
pcjd6321-Nov-08 5:59
pcjd6321-Nov-08 5:59 
GeneralRe: Parent form Text Pin
Pedram Behroozi21-Nov-08 6:42
Pedram Behroozi21-Nov-08 6:42 
QuestionEnable and Disable Certain cells in the WPF DataGrid Pin
chetanN21-Nov-08 2:33
chetanN21-Nov-08 2:33 
QuestionOpening large files to edit Pin
Matjaz-xyz21-Nov-08 1:27
Matjaz-xyz21-Nov-08 1:27 
AnswerRe: Opening large files to edit Pin
Pedram Behroozi21-Nov-08 1:31
Pedram Behroozi21-Nov-08 1:31 
AnswerRe: Opening large files to edit Pin
HosamAly21-Nov-08 8:19
HosamAly21-Nov-08 8:19 
QuestionMDI - Kinda... [modified] Pin
#realJSOP21-Nov-08 0:26
mve#realJSOP21-Nov-08 0: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.