diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-16 21:17:50 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-16 21:17:50 +0300 |
commit | 139b6566030af3106a28286e747b38ea45b1a428 (patch) | |
tree | 19f5fe55d10505691814916bc88dccecfef30a11 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs | |
parent | 06c3d9a60346f4313986c1b50de3f0786df65da9 (diff) |
Remove unnecessary use of GuiDispatch
Most of event subscriptions don't need to be wrapped with a GuiDispatch
generated delegate wrapper since the events are already dispatched in the
UI thread.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs index 0e70539c61..69ba9689d0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs @@ -47,9 +47,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad Xwt.Drawing.Image folderOpenIcon; Xwt.Drawing.Image folderClosedIcon; - EventHandler<FileCopyEventArgs> fileRenamedHandler; - EventHandler<FileEventArgs> fileRemovedHandler; - public override Type NodeDataType { get { return typeof(ProjectFolder); } } @@ -74,17 +71,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad folderOpenIcon = Context.GetIcon (Stock.OpenFolder); folderClosedIcon = Context.GetIcon (Stock.ClosedFolder); - - fileRenamedHandler = DispatchService.GuiDispatch<EventHandler<FileCopyEventArgs>> (OnFolderRenamed); - fileRemovedHandler = DispatchService.GuiDispatch<EventHandler<FileEventArgs>> (OnFolderRemoved); } public override void OnNodeAdded (object dataObject) { base.OnNodeAdded (dataObject); ProjectFolder folder = (ProjectFolder) dataObject; - folder.FolderRenamed += fileRenamedHandler; - folder.FolderRemoved += fileRemovedHandler; + folder.FolderRenamed += OnFolderRenamed; + folder.FolderRemoved += OnFolderRemoved; folder.TrackChanges = true; } @@ -92,8 +86,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad { base.OnNodeRemoved (dataObject); ProjectFolder folder = (ProjectFolder) dataObject; - folder.FolderRenamed -= fileRenamedHandler; - folder.FolderRemoved -= fileRemovedHandler; + folder.FolderRenamed -= OnFolderRenamed; + folder.FolderRemoved -= OnFolderRemoved; folder.Dispose (); } |