Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
AnswerRe: Compact Direct Acyclic ByteVector Graph Pin
leppie19-Oct-05 19:39
leppie19-Oct-05 19:39 
QuestionUser interface Pin
momoo19-Oct-05 16:38
momoo19-Oct-05 16:38 
AnswerRe: User interface Pin
timothycn19-Oct-05 17:01
timothycn19-Oct-05 17:01 
GeneralRe: User interface Pin
momoo19-Oct-05 17:37
momoo19-Oct-05 17:37 
GeneralRe: User interface Pin
timothycn19-Oct-05 17:41
timothycn19-Oct-05 17:41 
GeneralRe: User interface Pin
Jerry Hammond19-Oct-05 18:29
Jerry Hammond19-Oct-05 18:29 
GeneralRe: User interface Pin
momoo10-Nov-05 21:50
momoo10-Nov-05 21:50 
Question[C#] How to reference a parent class? Pin
Distinctive19-Oct-05 15:05
Distinctive19-Oct-05 15:05 
Hi,

Just wondering if anyone here can help me with a problem that I'm experiencing:

Basicly I would like to access a parent class from a DLL file.

Here is an example of what I'm talking about:

This is a chef program, used for automated cooking, it has a class libary with main functions, and class libaries for each kind DLL files. So for main cooking functions I have ChefProgram.Functions.dll, for baking a cake I have ChefProgram.Cake.dll, etc.

ChefProgram.Cake.dll
<br />
namespace ChefProgram <br />
{<br />
	class Cake : System.Web.UI.Page <br />
	{<br />
<br />
  public void Bake_A_Cake () <br />
  {<br />
  	/* Code to gather and mix ingredients */<br />
<br />
  	ChefProgram.Functions _maintasks = new ChefProgram.Functions(); <br />
  	_maintasks.Bake_In_Oven(item); <br />
<br />
  	/* Code to put icing on the cake */<br />
  }<br />
<br />
  public bool Item_Is_Cooked () <br />
  {<br />
  	if (Cake.Color = "golden brown") <br />
    return true; <br />
  	else <br />
    return false; <br />
  }<br />
<br />
	}<br />
}<br />

ChefProgram.Functions.dll
<br />
namespace ChefProgram <br />
{<br />
	class Functions : System.Web.IU.Page <br />
	{<br />
<br />
  public void Bake_In_Oven () <br />
  {<br />
  	Put in oven; <br />
  	bool Item_Cooked = false; <br />
  	while (!Item_Cooked)<br />
  	{<br />
    Item_Cooked = parent.Item_Is_Cooked(); << - I NEED TO KNOW HOW TO DO THIS!!<br />
  	} <br />
  	Take out oven; <br />
  }<br />
<br />
	}  <br />
}<br />


So we start in ShopProgram.Cake.DLL, in the "Bake_A_Cake()" proceedure, when it is time to put it in the oven we refer to the Functions class which has a "Bake_In_Oven" proceedure, because baking in an oven is something that you do for many dishes.

Since different dishes take different amounts of time to cook the ShopProgram.Cake.DLL also has a proceedure called "Item_Is_Cooked" which is designed to test if a cake is cooked, it then passes true or false back to the "Bake_In_Oven" procedure.

I haven't been able to figure out how to access the parent class to call the "Item_Is_Cooked" proceedure, does anybody know how to do this?

Thanks

-- modified at 21:07 Wednesday 19th October, 2005
AnswerRe: [C#] How to reference a parent class? Pin
MoustafaS19-Oct-05 15:16
MoustafaS19-Oct-05 15:16 
AnswerRe: [C#] How to reference a parent class? Pin
timothycn19-Oct-05 16:13
timothycn19-Oct-05 16:13 
Questionclipboard Pin
xilefxilef19-Oct-05 12:24
xilefxilef19-Oct-05 12:24 
QuestionRe: clipboard Pin
MoustafaS19-Oct-05 14:36
MoustafaS19-Oct-05 14:36 
AnswerRe: clipboard Pin
xilefxilef20-Oct-05 4:36
xilefxilef20-Oct-05 4:36 
Questionproblem decrypting a file Pin
Sasuko19-Oct-05 12:20
Sasuko19-Oct-05 12:20 
AnswerRe: problem decrypting a file Pin
leppie19-Oct-05 19:44
leppie19-Oct-05 19:44 
GeneralRe: problem decrypting a file Pin
Sasuko19-Oct-05 22:29
Sasuko19-Oct-05 22:29 
AnswerRe: problem decrypting a file Pin
leppie19-Oct-05 22:39
leppie19-Oct-05 22:39 
News71-528: TS: Microsoft&#174; .NET Framework 2.0 - Web-based Client Development Pin
vipul_vips19-Oct-05 12:16
vipul_vips19-Oct-05 12:16 
QuestionCOM Collections: How to use get_Item(ref object index) Pin
dkarlton19-Oct-05 12:07
dkarlton19-Oct-05 12:07 
AnswerRe: COM Collections: How to use get_Item(ref object index) Pin
leppie19-Oct-05 19:49
leppie19-Oct-05 19:49 
GeneralRe: COM Collections: How to use get_Item(ref object index) Pin
dkarlton20-Oct-05 3:12
dkarlton20-Oct-05 3:12 
GeneralRe: COM Collections: How to use get_Item(ref object index) Pin
dkarlton20-Oct-05 3:33
dkarlton20-Oct-05 3:33 
QuestionConfused On References Pin
budidharma19-Oct-05 12:01
budidharma19-Oct-05 12:01 
AnswerRe: Confused On References Pin
Matt Gerrans19-Oct-05 16:34
Matt Gerrans19-Oct-05 16:34 
GeneralRe: Confused On References Pin
budidharma19-Oct-05 17:32
budidharma19-Oct-05 17:32 

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.