diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/AddSidebarComponentsDialog.xfrm b/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/AddSidebarComponentsDialog.xfrm index 4e0b8481eb..a39876b7a4 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/AddSidebarComponentsDialog.xfrm +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Resources/AddSidebarComponentsDialog.xfrm @@ -1,64 +1,61 @@ - - - - - + + + - - + + + - - - + + + - - - - + + - - + + - - - - + + + + - - + + - + @@ -72,53 +69,50 @@ + - - - + + + - - + - - + - - - + + + - - - + - - + - - - + + + + - + @@ -133,41 +127,38 @@ - - - + - - + + - + - - + + - + + - - - + diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs index 8b02cc7ba5..058ae573f5 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs @@ -92,52 +92,48 @@ namespace ICSharpCode.FormsDesigner.Gui } catch {} } try { - Module[] ms = assembly.GetModules(false); ((ListView)ControlDictionary["componentListView"]).SmallImageList = il; - foreach (Module m in ms) { - Type[] ts = m.GetTypes(); - foreach (Type t in ts) { - if (t.IsPublic && !t.IsAbstract) { - if (t.IsDefined(typeof(ToolboxItemFilterAttribute), true) || t.IsDefined(typeof(ToolboxItemAttribute), true) || typeof(System.ComponentModel.IComponent).IsAssignableFrom(t)) { - object[] attributes = t.GetCustomAttributes(false); - object[] filterAttrs = t.GetCustomAttributes(typeof(DesignTimeVisibleAttribute), true); - foreach (DesignTimeVisibleAttribute visibleAttr in filterAttrs) { - if (!visibleAttr.Visible) { - goto skip; - } + foreach (Type t in assembly.GetExportedTypes()) { + if (!t.IsAbstract) { + if (t.IsDefined(typeof(ToolboxItemFilterAttribute), true) || t.IsDefined(typeof(ToolboxItemAttribute), true) || typeof(System.ComponentModel.IComponent).IsAssignableFrom(t)) { + object[] attributes = t.GetCustomAttributes(false); + object[] filterAttrs = t.GetCustomAttributes(typeof(DesignTimeVisibleAttribute), true); + foreach (DesignTimeVisibleAttribute visibleAttr in filterAttrs) { + if (!visibleAttr.Visible) { + goto skip; } - - if (images[t.FullName + ".bmp"] == null) { - if (t.IsDefined(typeof(ToolboxBitmapAttribute), false)) { - foreach (object attr in attributes) { - if (attr is ToolboxBitmapAttribute) { - ToolboxBitmapAttribute toolboxBitmapAttribute = (ToolboxBitmapAttribute)attr; - images[t.FullName + ".bmp"] = il.Images.Count; - Bitmap b = new Bitmap(toolboxBitmapAttribute.GetImage(t)); - b.MakeTransparent(); - il.Images.Add(b); - break; - } + } + + if (images[t.FullName + ".bmp"] == null) { + if (t.IsDefined(typeof(ToolboxBitmapAttribute), false)) { + foreach (object attr in attributes) { + if (attr is ToolboxBitmapAttribute) { + ToolboxBitmapAttribute toolboxBitmapAttribute = (ToolboxBitmapAttribute)attr; + images[t.FullName + ".bmp"] = il.Images.Count; + Bitmap b = new Bitmap(toolboxBitmapAttribute.GetImage(t)); + b.MakeTransparent(); + il.Images.Add(b); + break; } } } - - ListViewItem newItem = new ListViewItem(t.Name); - newItem.SubItems.Add(t.Namespace); - newItem.SubItems.Add(assembly.ToString()); - newItem.SubItems.Add(assembly.Location); - newItem.SubItems.Add(t.Namespace); - if (images[t.FullName + ".bmp"] != null) { - newItem.ImageIndex = (int)images[t.FullName + ".bmp"]; - } - newItem.Checked = true; - ToolComponent toolComponent = new ToolComponent(t.FullName, new ComponentAssembly(assembly.FullName, loadPath)); - toolComponent.IsEnabled = true; - newItem.Tag = toolComponent; - ((ListView)ControlDictionary["componentListView"]).Items.Add(newItem); - ToolboxItem item = new ToolboxItem(t); - skip:; } + + ListViewItem newItem = new ListViewItem(t.Name); + newItem.SubItems.Add(t.Namespace); + newItem.SubItems.Add(assembly.ToString()); + newItem.SubItems.Add(assembly.Location); + newItem.SubItems.Add(t.Namespace); + if (images[t.FullName + ".bmp"] != null) { + newItem.ImageIndex = (int)images[t.FullName + ".bmp"]; + } + newItem.Checked = true; + ToolComponent toolComponent = new ToolComponent(t.FullName, new ComponentAssembly(assembly.FullName, loadPath)); + toolComponent.IsEnabled = true; + newItem.Tag = toolComponent; + ((ListView)ControlDictionary["componentListView"]).Items.Add(newItem); + ToolboxItem item = new ToolboxItem(t); + skip:; } } } diff --git a/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs b/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs index a412babd6a..00bd216562 100644 --- a/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs +++ b/src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.Core project = ProjectService.OpenSolution.StartupProject; } foreach (DebuggerDescriptor d in debuggers) { - if (d.Debugger.CanDebug(project)) { + if (d.Debugger != null && d.Debugger.CanDebug(project)) { return d.Debugger; } }