Click here to Skip to main content
15,908,661 members
Home / Discussions / C#
   

C#

 
Questionmake a class property an array of an instantiated class? Pin
mmatteson18-Oct-06 11:56
mmatteson18-Oct-06 11:56 
v9ExportPacket p = new v9ExportPacket();

p.TemplateRecord = new TemplateRecord[5];

TemplateRecord t_tmp = new TemplateRecord();
t_tmp.FlowSetID=0;
t_tmp.Length=10;
t_tmp.id=23;
t_tmp.FieldCount=4;
t_tmp.Fields= new FieldPairs[t_tmp.FieldCount];
t_tmp.Fields[0] = new FieldPairs(1,2);
t_tmp.Fields[1] = new FieldPairs(3,4);
t_tmp.Fields[2] = new FieldPairs(5,6);
t_tmp.Fields[3] = new FieldPairs(7,8);

p.TemplateRecord[0] = t_tmp;


i was wondering if there is a way that i could just use
p.TemplateRecord[0].id=1;

instead of having to create a TemplateRecord object t_tmp to set the properties of that class and then set the TemplateRecord[0] property object equal to t_tmp object. i have looked into using indexers but i haven't seen an example where you could access a property of an indexed property.
AnswerRe: make a class property an array of an instantiated class? Pin
Christian Graus18-Oct-06 11:59
protectorChristian Graus18-Oct-06 11:59 
GeneralRe: make a class property an array of an instantiated class? Pin
mmatteson19-Oct-06 6:10
mmatteson19-Oct-06 6:10 
AnswerRe: make a class property an array of an instantiated class? Pin
Andrew Rissing18-Oct-06 12:16
Andrew Rissing18-Oct-06 12:16 
GeneralRe: make a class property an array of an instantiated class? Pin
mmatteson18-Oct-06 16:32
mmatteson18-Oct-06 16:32 
QuestionGraphics Pin
Areff18-Oct-06 10:59
Areff18-Oct-06 10:59 
AnswerRe: Graphics Pin
Christian Graus18-Oct-06 11:03
protectorChristian Graus18-Oct-06 11:03 
GeneralRe: Graphics Pin
Areff18-Oct-06 11:12
Areff18-Oct-06 11:12 
GeneralRe: Graphics Pin
Christian Graus18-Oct-06 11:33
protectorChristian Graus18-Oct-06 11:33 
GeneralRe: Graphics Pin
V.19-Oct-06 4:51
professionalV.19-Oct-06 4:51 
AnswerRe: Graphics Pin
V.19-Oct-06 4:50
professionalV.19-Oct-06 4:50 
AnswerRe: Graphics Pin
Bekjong19-Oct-06 5:37
Bekjong19-Oct-06 5:37 
QuestionObjectDisposedException Pin
Yustme18-Oct-06 9:47
Yustme18-Oct-06 9:47 
AnswerRe: ObjectDisposedException Pin
Christian Graus18-Oct-06 10:02
protectorChristian Graus18-Oct-06 10:02 
GeneralRe: ObjectDisposedException Pin
Yustme18-Oct-06 10:23
Yustme18-Oct-06 10:23 
AnswerRe: ObjectDisposedException Pin
Le centriste19-Oct-06 4:23
Le centriste19-Oct-06 4:23 
QuestionPartial Classes - What's The Big Deal? Pin
#realJSOP18-Oct-06 9:22
professional#realJSOP18-Oct-06 9:22 
AnswerRe: Partial Classes - What's The Big Deal? Pin
Andrew Rissing18-Oct-06 9:27
Andrew Rissing18-Oct-06 9:27 
GeneralRe: Partial Classes - What's The Big Deal? Pin
Christian Graus18-Oct-06 10:04
protectorChristian Graus18-Oct-06 10:04 
GeneralRe: Partial Classes - What's The Big Deal? Pin
Andrew Rissing18-Oct-06 11:57
Andrew Rissing18-Oct-06 11:57 
GeneralRe: Partial Classes - What's The Big Deal? Pin
Christian Graus18-Oct-06 11:58
protectorChristian Graus18-Oct-06 11:58 
GeneralRe: Partial Classes - What's The Big Deal? Pin
Andrew Rissing19-Oct-06 5:40
Andrew Rissing19-Oct-06 5:40 
GeneralRe: Partial Classes - What's The Big Deal? Pin
Kevin McFarlane18-Oct-06 12:26
Kevin McFarlane18-Oct-06 12:26 
AnswerRe: Partial Classes - What's The Big Deal? Pin
Christian Graus18-Oct-06 10:03
protectorChristian Graus18-Oct-06 10:03 
GeneralRe: Partial Classes - What's The Big Deal? Pin
#realJSOP18-Oct-06 10:21
professional#realJSOP18-Oct-06 10:21 

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.