tEMPLATE CALSS LIBRARIES IN c#

Sir,
I am facing an certain problem , i am trying to convert a piece of code in VisaualC# .hope some body will helpme out about this how can it be done.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

class grip: public wait<grip>

{

public:

int make[5];

int rate;

grip(int x, int y, int s, int d, int t, int v) {

make [0]=x; make [1]=y; make [2]=s; make [3]=d; make [4]=t;

rate=v;

new=NULL;

}

};

// Class used to store detections

class deceit : public wait < deceit >

{

public:

int x, y, s, orient, profile;

double output;

deceit (int xx, int yy, int ss, double o, int dir, int pr=0) {

x=xx; y=yy; s=ss; output=o; orient=dir; profile=pr;

}

};

template <class T>

class wait

{

public:

T *old, *new;

wait();

~wait();

};

How can i convert this code to c#.

waiting for reply eagerly.

Regards

Naveen

[4081 byte] By [Naveenkoul] at [2007-12-16]
# 1
C# 2.0 has templates. They're called "Generics". Your wait class would look something like this...



public class Wait<T>
{
public T Old
{
get{ return oldValue; }
set{ oldValue = value; }
}

public T New
{
get{ return newValue; }
set{ newValue = value; }
}

private T oldValue;
private T newValue;
}

dkocur2 at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# Language...