Author: mhutch
Date: 2005-09-02 07:20:33 -0400 (Fri, 02 Sep 2005)
New Revision: 49338

Modified:
   
trunk/aspeditor/src/editor/AspNetEdit.Editor.ComponentModel/DesignContainer.cs
   trunk/aspeditor/src/editor/AspNetEdit.Editor.UI/RootDesignerView.cs
Log:
Deselect component when removed from DesignContainer


Modified: 
trunk/aspeditor/src/editor/AspNetEdit.Editor.ComponentModel/DesignContainer.cs
===================================================================
--- 
trunk/aspeditor/src/editor/AspNetEdit.Editor.ComponentModel/DesignContainer.cs  
    2005-09-02 10:27:31 UTC (rev 49337)
+++ 
trunk/aspeditor/src/editor/AspNetEdit.Editor.ComponentModel/DesignContainer.cs  
    2005-09-02 11:20:33 UTC (rev 49338)
@@ -179,7 +179,12 @@
                        }
                        
                        //TODO: remove references from referenceManager
-
+                       
+                       //clean up selection service
+                       ISelectionService sel = (ISelectionService) 
this.GetService (typeof (ISelectionService));
+                       if (sel != null && sel.GetComponentSelected (component))
+                               sel.SetSelectedComponents (new IComponent[] 
{}); 
+                       
                        //broadcast completion of removal process
                        OnComponentRemoved (component);
                }

Modified: trunk/aspeditor/src/editor/AspNetEdit.Editor.UI/RootDesignerView.cs
===================================================================
--- trunk/aspeditor/src/editor/AspNetEdit.Editor.UI/RootDesignerView.cs 
2005-09-02 10:27:31 UTC (rev 49337)
+++ trunk/aspeditor/src/editor/AspNetEdit.Editor.UI/RootDesignerView.cs 
2005-09-02 11:20:33 UTC (rev 49338)
@@ -166,7 +166,7 @@
                        comm.JSCall (GeckoFunctions.InsertFragment, null, 
host.RootDocument.Serialize (fragment));
                }
                
-               internal void AddControl(Control control)
+               internal void AddControl (Control control)
                {
                        if (!active) return;
                        
@@ -174,14 +174,14 @@
                        comm.JSCall (GeckoFunctions.AddControl, null, 
control.UniqueID, ctext);
                }
 
-               internal void RemoveControl(Control control)
+               internal void RemoveControl (Control control)
                {
                        if (!active) return;
                        
                        comm.JSCall (GeckoFunctions.RemoveControl, null, 
control.UniqueID);
                }
                
-               internal void RenameControl(string oldName, string newName)
+               internal void RenameControl (string oldName, string newName)
                {
                        throw new NotImplementedException ();
                }
@@ -370,16 +370,18 @@
                private string JSRemoveControl (string[] args)
                {
                        if (args.Length != 1)
-                               throw new InvalidJSArgumentException 
("ResizeControl", -1);
+                               throw new InvalidJSArgumentException 
("RemoveControl", -1);
                                
                        //look up our component
                        DesignContainer container = (DesignContainer) 
host.Container;
                        IComponent component = container.GetComponent (args[0]);
                        if (component == null)
-                               throw new InvalidJSArgumentException 
("ResizeControl", 0);
+                               throw new InvalidJSArgumentException 
("RemoveControl", 0);
                        
                        //and remove it
+                       System.Diagnostics.Trace.WriteLine ("Removing control: 
" + args[0]);
                        container.Remove (component);
+                       component.Dispose ();
                        
                        return string.Empty;
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to