| | |
class constructor help
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2007
Posts: 23
Reputation:
Solved Threads: 0
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
}
}
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
}
}
![]() |
Similar Threads
- PHP HTTP Screen-Scraping Class with Caching (PHP)
- How Do I . . . Make a Class Accessible from a DLL (C++)
- Class Constructor Shorthand (C++)
- Class Vectorization requirements (C++)
- class rectangle (Java)
- Help : Pointers to array of class objects . (C++)
- Instantiating class objects?? (C++)
- Developing A Class (C++)
- 6 Line class -> Me pounding head into wall (C)
- '[Class] is not abstract..' error when i use 'implements' (Java)
Other Threads in the C# Forum
- Previous Thread: Question in c#& database
- Next Thread: C#
| Thread Tools | Search this Thread |
.net access activedirectory ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox connect control conversion cryptographyc#winformsencryption csharp custom database datagrid datagridview dataset datetime degrees development disabled displayingopenforms draganddrop drawing encryption enum event excel file foreach form format forms ftp function gdi+ httpwebrequest image index index-error input install java label list listbox mandelbrot math mathematics mouseclick mysql operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox serialization server setup sleep socket sql statistics stream string table text textbox thread time timer totaldays update user usercontrol validation visualstudio webbrowser windows winforms wpf xml






