Click here to Skip to main content
15,887,083 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# App on the web Pin
Gareth H5-Feb-08 6:59
Gareth H5-Feb-08 6:59 
GeneralRe: C# App on the web Pin
Gareth H5-Feb-08 7:27
Gareth H5-Feb-08 7:27 
GeneralRe: C# App on the web Pin
Gareth H5-Feb-08 8:14
Gareth H5-Feb-08 8:14 
GeneralRe: C# App on the web Pin
Jasmine25015-Feb-08 14:38
Jasmine25015-Feb-08 14:38 
GeneralRe: C# App on the web Pin
Gareth H5-Feb-08 22:10
Gareth H5-Feb-08 22:10 
GeneralCharacter matching Pin
netJP12L5-Feb-08 5:51
netJP12L5-Feb-08 5:51 
GeneralRe: Character matching Pin
TJoe5-Feb-08 5:56
TJoe5-Feb-08 5:56 
QuestionWhen do I need to override constructors for GetConstructor? Pin
RichardM15-Feb-08 5:41
RichardM15-Feb-08 5:41 
I have a class class1, which has a constructor and one method:
public class1(TextReader tr)
{
  InitFromTextReader(tr);
}
protected virtual bool InitFromTextReader(TextReader tr)
{
  // init code goes here
}

It has subclass class1_1, which also has a subclass class1_1_1.
These two classes both override InitFromTextReader.

The text stream I am reading has class names embedded in it, just before the data for the object. So I read the class name, get the Type object for it and ask for the constructor that takes a TextReader as it's one and only parameter.

GetConstructor is not finding that constructor for the subclasses. I used GetConstructors, and it just does not exist.

So, all that to ask:
Even though they do not do a dang thing, do I need to write constructors
public class1_1(TextReader tr)
  : base(tr)
{
}
and
public class1_1_1(TextReader tr)
  : base(tr)
{
}

so that I can find them with GetConstructor?
It this kind of thing wot causes unrest!

Learn to write self marginalizing code!
Call 1-888-BAD-CODE

AnswerRe: When do I need to override constructors for GetConstructor? Pin
TJoe5-Feb-08 5:44
TJoe5-Feb-08 5:44 
GeneralRe: When do I need to override constructors for GetConstructor? Pin
RichardM15-Feb-08 5:52
RichardM15-Feb-08 5:52 
GeneralRe: When do I need to override constructors for GetConstructor? Pin
TJoe5-Feb-08 5:55
TJoe5-Feb-08 5:55 
GeneralResizing 2 dimensional array Pin
Nadia Monalisa5-Feb-08 5:10
Nadia Monalisa5-Feb-08 5:10 
GeneralRe: Resizing 2 dimensional array Pin
Spacix One5-Feb-08 5:23
Spacix One5-Feb-08 5:23 
GeneralRe: Resizing 2 dimensional array Pin
Nadia Monalisa5-Feb-08 5:37
Nadia Monalisa5-Feb-08 5:37 
GeneralRe: Resizing 2 dimensional array Pin
RichardM15-Feb-08 5:43
RichardM15-Feb-08 5:43 
GeneralRe: Resizing 2 dimensional array Pin
Spacix One5-Feb-08 6:00
Spacix One5-Feb-08 6:00 
AnswerRe: Resizing 2 dimensional array Pin
Guffa5-Feb-08 7:26
Guffa5-Feb-08 7:26 
GeneralCreateProcess as user error 1314. Pin
PhrankBooth5-Feb-08 4:07
PhrankBooth5-Feb-08 4:07 
GeneralRe: CreateProcess as user error 1314. Pin
TJoe5-Feb-08 4:14
TJoe5-Feb-08 4:14 
Generalopen excel with addins Pin
arkiboys5-Feb-08 3:52
arkiboys5-Feb-08 3:52 
Generalreading HTML file and Append text Pin
gottimukkala5-Feb-08 3:47
gottimukkala5-Feb-08 3:47 
GeneralRe: reading HTML file and Append text Pin
TJoe5-Feb-08 4:36
TJoe5-Feb-08 4:36 
GeneralRe: reading HTML file and Append text Pin
gottimukkala5-Feb-08 4:51
gottimukkala5-Feb-08 4:51 
GeneralRe: reading HTML file and Append text Pin
TJoe5-Feb-08 4:56
TJoe5-Feb-08 4:56 
GeneralRe: reading HTML file and Append text Pin
gottimukkala5-Feb-08 5:20
gottimukkala5-Feb-08 5:20 

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.