Click here to Skip to main content
15,925,723 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionMail forwarding on MS Exchange 2007 Pin
deepak__sharma18-Mar-09 20:11
deepak__sharma18-Mar-09 20:11 
AnswerRe: Mail forwarding on MS Exchange 2007 Pin
Abhijit Jana22-Mar-09 0:45
professionalAbhijit Jana22-Mar-09 0:45 
GeneralRe: Mail forwarding on MS Exchange 2007 Pin
deepak__sharma23-Mar-09 18:02
deepak__sharma23-Mar-09 18:02 
QuestionDo I need to release .NET 3.5 SP1 to all users? Pin
PSU Steve18-Mar-09 4:36
professionalPSU Steve18-Mar-09 4:36 
AnswerRe: Do I need to release .NET 3.5 SP1 to all users? Pin
led mike18-Mar-09 5:35
led mike18-Mar-09 5:35 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
PSU Steve18-Mar-09 5:54
professionalPSU Steve18-Mar-09 5:54 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Ravadre18-Mar-09 6:05
Ravadre18-Mar-09 6:05 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
supercat920-Mar-09 11:54
supercat920-Mar-09 11:54 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Ravadre20-Mar-09 11:56
Ravadre20-Mar-09 11:56 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? [modified] Pin
led mike18-Mar-09 7:35
led mike18-Mar-09 7:35 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Dave Kreskowiak18-Mar-09 10:45
mveDave Kreskowiak18-Mar-09 10:45 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
led mike19-Mar-09 4:33
led mike19-Mar-09 4:33 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Pete O'Hanlon19-Mar-09 12:57
mvePete O'Hanlon19-Mar-09 12:57 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
led mike20-Mar-09 4:37
led mike20-Mar-09 4:37 
GeneralRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Dave Kreskowiak19-Mar-09 14:04
mveDave Kreskowiak19-Mar-09 14:04 
AnswerRe: Do I need to release .NET 3.5 SP1 to all users? Pin
Simon P Stevens18-Mar-09 6:51
Simon P Stevens18-Mar-09 6:51 
QuestionSiteLock template on C# Pin
budarin17-Mar-09 11:57
budarin17-Mar-09 11:57 
QuestionIDisposable, Inheritance and Event Handlers Pin
Alex Feature17-Mar-09 9:36
Alex Feature17-Mar-09 9:36 
AnswerRe: IDisposable, Inheritance and Event Handlers Pin
Natza Mitzi17-Mar-09 10:02
Natza Mitzi17-Mar-09 10:02 
Hi, you need to override and not overload. all dispose methods should be called from the leaf type to the top. I think that you should clean up after your self when creating objects that are disposable. in large objects you should also set values to null explicitly to free the memory faster. The next code calls all methods when disposing:



///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{

//This code should go in the main
//ObjectB1 inherits from ObjectB which innhertis from ObjectA
ObjectB1 b1 = new ObjectB1();

//Calling the dispose will call the dispose of ObjectB1
//within the dispose of ObjectB1 there is a call to the base dispose.

b1.Dispose();
}


public partial class ObjectA : UserControl
{
public ObjectA()
{
InitializeComponent();
}

private void ObjectA_Load(object sender, EventArgs e)
{

}
}

public class ObjectB : ObjectA
{
public event EventHandler ObjectBEvent;

public ObjectB()
{
this.MouseClick += new MouseEventHandler(ObjectB_MouseClick);
}

void ObjectB_MouseClick(object sender, MouseEventArgs e)
{

}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);

MessageBox.Show("Dispose : ObjectB");
ObjectBEvent = null;
}

protected virtual void OnObjectBEvent(EventArgs e)
{
if (ObjectBEvent != null)
{
ObjectBEvent(this, e);
}
}
}

public class ObjectB1 : ObjectB
{
public event EventHandler ObjectB1Event;

public ObjectB1()
{
this.MouseClick += new MouseEventHandler(ObjectB1_MouseClick);
}

void ObjectB1_MouseClick(object sender, MouseEventArgs e)
{

}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);

MessageBox.Show("Dispose : ObjectB1");
ObjectB1Event = null;
}

protected virtual void OnObjectB1Event(EventArgs e)
{
if (ObjectB1Event != null)
{
ObjectB1Event(this, e);
}
}
}

Natza Mitzi

GeneralRe: IDisposable, Inheritance and Event Handlers Pin
Alex Feature17-Mar-09 21:07
Alex Feature17-Mar-09 21:07 
GeneralRe: IDisposable, Inheritance and Event Handlers Pin
Alex Feature18-Mar-09 2:07
Alex Feature18-Mar-09 2:07 
GeneralRe: IDisposable, Inheritance and Event Handlers Pin
Natza Mitzi18-Mar-09 3:30
Natza Mitzi18-Mar-09 3:30 
AnswerRe: IDisposable, Inheritance and Event Handlers Pin
S. Senthil Kumar19-Mar-09 3:53
S. Senthil Kumar19-Mar-09 3:53 
QuestionProblem in creating website with CMS Pin
itsravie17-Mar-09 5:37
itsravie17-Mar-09 5:37 
AnswerPick a forum and stick with it. Pin
Pete O'Hanlon17-Mar-09 6:07
mvePete O'Hanlon17-Mar-09 6:07 

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.