Click here to Skip to main content
15,914,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: start IE without addressbar, status bar Pin
DanB19838-May-08 12:04
DanB19838-May-08 12:04 
GeneralRe: start IE without addressbar, status bar Pin
sikp8-May-08 12:36
sikp8-May-08 12:36 
GeneralRe: start IE without addressbar, status bar Pin
PIEBALDconsult8-May-08 13:57
mvePIEBALDconsult8-May-08 13:57 
GeneralRe: start IE without addressbar, status bar Pin
sikp8-May-08 14:12
sikp8-May-08 14:12 
GeneralRe: start IE without addressbar, status bar Pin
DanB19838-May-08 21:34
DanB19838-May-08 21:34 
GeneralRe: start IE without addressbar, status bar Pin
sikp8-May-08 21:57
sikp8-May-08 21:57 
GeneralRe: start IE without addressbar, status bar Pin
DanB19838-May-08 22:01
DanB19838-May-08 22:01 
QuestionWriting a raytracer to learn the language... hit a problem.... Pin
bobmitch8-May-08 11:00
bobmitch8-May-08 11:00 
I am writing a simple raytracer in C# as a way of learning the language - but have run into a problem:

I have a parent class called "Primitive" which has an "Intersection" function.

I have multiple child classes, for example "Sphere" which overwrite the "Intersection" function with "new public Intersection... etc..." as their intersection methods are all quite different.

This works fine for single instances - but when I create an arraylist of primitives, such as Spheres and Planes, and the iterate through them with a foreach like this:

ArrayList PrimList = new ArrayList();

Sphere sphere = new Sphere ();
PrimList.Add (sphere);
Plane plane = new Plane();
PrimList.Add (plane);

foreach (Primitive p in PrimList)
{
i =p.Intersect (x);
}

This will always use the parent intersect function and not the appropriate child function. :/
I think it's because the Spheres are being recasted to Primitives by the foreach function....

Is there a way around this such that the correct intersection method is used?
AnswerRe: Writing a raytracer to learn the language... hit a problem.... Pin
Colin Angus Mackay8-May-08 11:05
Colin Angus Mackay8-May-08 11:05 
QuestionNEW operator Pin
AlexPizzano8-May-08 10:48
AlexPizzano8-May-08 10:48 
AnswerRe: NEW operator Pin
Colin Angus Mackay8-May-08 11:02
Colin Angus Mackay8-May-08 11:02 
QuestionHow to free up memory in C# applications? Pin
Noemi Katinka8-May-08 9:29
Noemi Katinka8-May-08 9:29 
AnswerRe: How to free up memory in C# applications? Pin
Gareth H8-May-08 9:43
Gareth H8-May-08 9:43 
AnswerRe: How to free up memory in C# applications? Pin
Christian Graus8-May-08 11:10
protectorChristian Graus8-May-08 11:10 
AnswerRe: How to free up memory in C# applications? Pin
tgrt8-May-08 11:14
tgrt8-May-08 11:14 
AnswerRe: How to free up memory in C# applications? Pin
stano8-May-08 11:54
stano8-May-08 11:54 
QuestionOleDB DataReader not working Pin
Cozmo238-May-08 9:22
Cozmo238-May-08 9:22 
AnswerRe: OleDB DataReader not working Pin
Ennis Ray Lynch, Jr.8-May-08 9:26
Ennis Ray Lynch, Jr.8-May-08 9:26 
AnswerRe: OleDB DataReader not working Pin
deepu5559-May-08 12:09
deepu5559-May-08 12:09 
Questionurgent: tree diagram in C# .NET Pin
rasana8-May-08 9:16
rasana8-May-08 9:16 
AnswerRe: urgent: tree diagram in C# .NET Pin
Ennis Ray Lynch, Jr.8-May-08 9:19
Ennis Ray Lynch, Jr.8-May-08 9:19 
AnswerRe: urgent: tree diagram in C# .NET Pin
Gareth H8-May-08 9:38
Gareth H8-May-08 9:38 
AnswerRe: urgent: tree diagram in C# .NET Pin
Le centriste8-May-08 10:12
Le centriste8-May-08 10:12 
AnswerRe: urgent: tree diagram in C# .NET Pin
rasana15-May-08 5:19
rasana15-May-08 5:19 
QuestionWhat is the fastest way to update a UI from a thread? Pin
GuyThiebaut8-May-08 9:03
professionalGuyThiebaut8-May-08 9:03 

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.