Skip to content

Commit

Permalink
Fixed one potential issue after disposal.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Apr 28, 2012
1 parent cf62273 commit 4c01bdc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
15 changes: 11 additions & 4 deletions Crad.Windows.Forms.Actions/ActionList.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections.Generic;
Expand Down Expand Up @@ -35,7 +35,14 @@ public ToolTip ToolTip
#region events and event raisers
void Application_Idle(object sender, EventArgs e)
{
OnUpdate(EventArgs.Empty);
if (ContainerControl.IsDisposed)
{
Application.Idle -= Application_Idle;
}
else
{
OnUpdate(EventArgs.Empty);
}
}

public event EventHandler Update;
Expand Down Expand Up @@ -98,7 +105,7 @@ public void SetAction(Component extendee, Action action)
throw new ArgumentException("The Action you selected is owned by another ActionList");
}

/* Se extendee appartiene già alla collection, rimuovo l'handler
/* Se extendee appartiene gi?alla collection, rimuovo l'handler
* sul suo evento Click e lo rimuovo dai component associati alla
* collection */
if (targets.ContainsKey(extendee))
Expand Down Expand Up @@ -181,7 +188,7 @@ private void refreshActions()
private void checkInternalCollections()
{
/* questo metodo verifica che ogni action su targets
* appartenga a questa actionList e che abbia la proprietà
* appartenga a questa actionList e che abbia la propriet?
* ActionList correttamente impostata */
foreach (Action action in targets.Values)
{
Expand Down
4 changes: 2 additions & 2 deletions Crad.Windows.Forms.Actions/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.1.0")]
[assembly: AssemblyFileVersion("1.1.1.0")]
[assembly: AssemblyVersion("1.1.2.0")]
[assembly: AssemblyFileVersion("1.1.2.0")]
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
ActionListWinForms
ActionList for Windows Forms/.NET
==================

ActionList for Windows Forms/.NET
This project is originally developed by Marco De Sanctis and released under Common Public License 1.0. It hasn't been updated for a while,

http://www.codeproject.com/Articles/13879/ActionList-for-NET-2-0

This fork is aiming to provide bug fixes based on its 1.1.1.0 release.

0 comments on commit 4c01bdc

Please sign in to comment.