class constructor help

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 23
Reputation: dc_24l is an unknown quantity at this point 
Solved Threads: 0
dc_24l dc_24l is offline Offline
Newbie Poster

class constructor help

 
0
  #1
Dec 26th, 2007
hi im a newbie in C# i just have a question where do i put in the code this one

samplePX = new exPX(this);

because im trying to do a sample program that i am reading and practicing right now and it says "Create an object in your task class constructor. Use the code:
samplePX = new exPX(this);"

where do i put samplePX = new exPX(this); in the following code? thanks.

using System;
using System.Configuration;
using System.Globalization;


namespace Sample
{
/// <summary>
/// Summary description for RunEx.
/// </summary>
public class RunEx : TaskBase
{
/// <summary>
/// Required designer variable.
/// </summary>
private DataLink dataLink1;

private string HTML_PATH;

#region TaskBase overloads

/// <summary>
/// InitializeTask: initializes the task.
/// </summary>
protected override void InitializeTask()
{
HTML_PATH = ConfigurationManager.AppSettings["HTML Path"];


#region Create Used Objects

dataLink1 = new DataLink();

#endregion

#region Event Hookup


#endregion
}

/// <summary>
/// Start: this method is called to inform the task that it should activate.
/// </summary>
public override void Start(int action)
{
Log.LogInfo( "Start {0}", action );

// TODO: implement your tasks logic here

// When your task is finished, call
// base.SetResult( int result ) or
// base.SetResult( string result )
//
// Always make sure that the result you set is declared in AssemblyInfo.cs
}

/// <summary>
/// Quit: this method is executed before the task is unloaded.
/// </summary>
public override void Quit( QuitReason reason )
{
Dispose( );
}

#endregion


/// <summary>
/// Clean up any resources being used.
/// </summary>
#region Dispose

protected override void Dispose( bool disposing )
{
try
{
if ( ! Disposed )
{
if ( disposing )
{
// Here (and only here) I should dispose managed resources
Browser.Dispose();

}
// Here I should dispose unmanaged resources (but not managed resources!)

}
}
finally
{
// And call the base class
base.Dispose( disposing );
}
}

#endregion

#region Event Handlers


#endregion

}
}
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: class constructor help

 
0
  #2
Dec 27th, 2007
I'm not really sure I understand exactly what you're asking. Theres obviously some enums or other classes that we're not being provided here. If I just compiled this code as-is, there would be a bunch of undefined references.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC