In Delphi, when i want to create an object from uncertain derived class, i was using class of statement;
TShape = class
public
procedure Draw;
end;
TCircle = class(TShape)
public
procedure Draw;
end;
TShapeClassRef = class of TShape;
and i was creating object as;
var
ref:TShapeClassRef;
drawing:TShape;
begin
ref:=TCircle;
drawing:=ref.Create;
drawing.draw; //this is a circle object, and it draws circle
end;
I couldn't find anything like that in c#.
Activator.CreateInstance(yourTypeGoesHere)?