Author: mhutch
Date: 2006-08-05 12:06:02 -0400 (Sat, 05 Aug 2006)
New Revision: 63389

Modified:
   trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/ChangeLog
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/UnknownToolboxNode.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindService.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DesignerSupportService.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
Log:
2006-07-29  Michael Hutchinson <[EMAIL PROTECTED]>

        * MonoDevelop.DesignerSupport/ToolboxPad.cs:
          Clean up namespace alias.
          
        * MonoDevelop.DesignerSupport/BindingService.cs:
          Add a lot of methods to support AspNetEdit event binding.
          Make static, becuase there's nothing large to initialise.
          Enable refactoring of open files (broken for secondary ViewContents).
          
        * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
          Fix exception handling and GUI threading.
          
        * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
          Remove Binding service; it's now static.
          
        * MonoDevelop.DesignerSupport/WrapperDesignView.cs:
          Dispose child ViewContent content.
          
        * MonoDevelop.DesignerSupport/ToolboxService.cs:
        * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs:
          Support for displaying dynamic items provided by current consumer.
          Rename Use method to ConsumeItem.
          Hide UnknownToolboxNodes.
        
        * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs:
          Load file into child view. No idea why this was working before.
          
        * MonoDevelop.DesignerSupport/ToolboxPad.cs:
        * MonoDevelop.DesignerSupport/BindingService.cs:
        * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
        * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
        * MonoDevelop.DesignerSupport/CodeBehindService.cs:
        * MonoDevelop.DesignerSupport/MemberExistsException.cs:
        * MonoDevelop.DesignerSupport/ToolboxService.cs:
        * MonoDevelop.DesignerSupport/PropertyPad.cs:
        * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs:
        * MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs:
        * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs:
        * MonoDevelop.DesignerSupport.Toolbox/UnknownToolboxNode.cs:
        * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
        * MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs:
          Add missing copyright information.



Modified: trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/ChangeLog      
2006-08-05 14:55:49 UTC (rev 63388)
+++ trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/ChangeLog      
2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,47 @@
+2006-07-29  Michael Hutchinson <[EMAIL PROTECTED]>
+
+       * MonoDevelop.DesignerSupport/ToolboxPad.cs:
+         Clean up namespace alias.
+         
+       * MonoDevelop.DesignerSupport/BindingService.cs:
+         Add a lot of methods to support AspNetEdit event binding.
+         Make static, becuase there's nothing large to initialise.
+         Enable refactoring of open files (broken for secondary ViewContents).
+         
+       * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
+         Fix exception handling and GUI threading.
+         
+       * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
+         Remove Binding service; it's now static.
+         
+       * MonoDevelop.DesignerSupport/WrapperDesignView.cs:
+         Dispose child ViewContent content.
+         
+       * MonoDevelop.DesignerSupport/ToolboxService.cs:
+       * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs:
+         Support for displaying dynamic items provided by current consumer.
+         Rename Use method to ConsumeItem.
+         Hide UnknownToolboxNodes.
+       
+       * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs:
+         Load file into child view. No idea why this was working before.
+         
+       * MonoDevelop.DesignerSupport/ToolboxPad.cs:
+       * MonoDevelop.DesignerSupport/BindingService.cs:
+       * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
+       * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
+       * MonoDevelop.DesignerSupport/CodeBehindService.cs:
+       * MonoDevelop.DesignerSupport/MemberExistsException.cs:
+       * MonoDevelop.DesignerSupport/ToolboxService.cs:
+       * MonoDevelop.DesignerSupport/PropertyPad.cs:
+       * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs:
+       * MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs:
+       * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs:
+       * MonoDevelop.DesignerSupport.Toolbox/UnknownToolboxNode.cs:
+       * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
+       * MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs:
+         Add missing copyright information.
+
 2006-08-04 Lluis Sanchez Gual  <[EMAIL PROTECTED]> 
 
        * MonoDevelop.DesignerSupport/WrapperDesignView.cs: Add support

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
  2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
  2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,8 +1,43 @@
+//
+// BindingService.cs: Utility methods for binding CodeBehind members.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using System.CodeDom;
+using System.Reflection;
+using System.Collections.Generic;
 
 using MonoDevelop.Projects.Parser;
+using MonoDevelop.Projects.Text;
+using MonoDevelop.Projects.CodeGeneration;
+using MonoDevelop.Ide.Gui;
 
 namespace MonoDevelop.DesignerSupport
 {
@@ -13,12 +48,14 @@
                //TODO: currently case-sensitive, so some languages may not 
like this
                const bool ignoreCase = false;
                
-               internal BindingService ()
+               private static ITextFileProvider openedFileProvider = new 
OpenDocumentFileProvider ();
+               
+               private BindingService ()
                {
                }
                
-               //TODO: modifying file view in-place
-               public void AddMemberToClass (IClass cls, CodeTypeMember 
member, bool throwIfExists)
+               
+               public static IMember AddMemberToClass (IClass cls, 
CodeTypeMember member, bool throwIfExists)
                {               
                        
                        //check for identical property names
@@ -32,7 +69,7 @@
                                        if (memProp.Type.BaseType != 
prop.ReturnType.FullyQualifiedName)
                                                throw new 
InvalidOperationException ("Return type does not match");
                                        
-                                       return;
+                                       return prop;
                                }
                        }
                                
@@ -47,7 +84,7 @@
                                        if (memMeth.ReturnType.BaseType != 
meth.ReturnType.FullyQualifiedName)
                                                throw new 
InvalidOperationException ("Return type does not match");
                                        
-                                       return;
+                                       return meth;
                                }
                        }
                        
@@ -62,7 +99,7 @@
                                        if (memEv.Type.BaseType != 
ev.ReturnType.FullyQualifiedName)
                                                throw new 
InvalidOperationException ("Return type does not match");
 
-                                       return;
+                                       return ev;
                                }
                        }
                                
@@ -77,15 +114,173 @@
                                        if (memField.Type.BaseType != 
field.ReturnType.FullyQualifiedName)
                                                throw new 
InvalidOperationException ("Return type does not match");
                                        
-                                       return;
+                                       return field;
                                }
                        }
                        
-                       
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.CodeRefactorer.AddMember (cls, 
member);
+                       return GetCodeGenerator ().AddMember (cls, member);
                }
                
+               static CodeRefactorer GetCodeGenerator ()
+               {                       
+                       CodeRefactorer cr = new CodeRefactorer 
(IdeApp.ProjectOperations.CurrentOpenCombine, 
IdeApp.ProjectOperations.ParserDatabase);
+                       cr.TextFileProvider = openedFileProvider;
+                       return cr;
+               }
                
+               //copied from MonoDevelop.GtkCore.GuiBuilder
+               private class OpenDocumentFileProvider: ITextFileProvider
+               {
+                       public IEditableTextFile GetEditableTextFile (string 
filePath)
+                       {
+                               foreach (Document doc in 
IdeApp.Workbench.Documents) {
+                                       //FIXME: look in other views
+                                       if (doc.FileName == filePath) {
+                                               IEditableTextFile ef = 
doc.Content as IEditableTextFile;
+                                               if (ef != null) return ef;
+                                       }
+                               }
+                               return null;
+                       }
+               }
                
+               //TODO: check accessibility
+               public static string[] GetCompatibleMethodsInClass (IClass cls, 
CodeMemberMethod testMethod)
+               {
+                       List<string> list = new List<string> ();
+                       
+                       foreach (IMethod method in cls.Methods) {
+                               if (method.Parameters.Count != 
testMethod.Parameters.Count)
+                                       continue;
+                               
+                               if (method.ReturnType.FullyQualifiedName != 
testMethod.ReturnType.BaseType)
+                                       continue;
+                               
+                               //compare each parameter
+                               bool mismatch = false;
+                               for (int i = 0; i < 
testMethod.Parameters.Count; i++)
+                                       if 
(method.Parameters[i].ReturnType.FullyQualifiedName != 
testMethod.Parameters[i].Type.BaseType)
+                                               mismatch = true;
+                               
+                               if (!mismatch)
+                                       list.Add (method.Name);
+                       }
+                       
+                       return list.ToArray ();
+               }
                
+               
+               public static string[] GetCompatibleMembersInClass (IClass cls, 
CodeTypeMember testMember)
+               {
+                       if (testMember is CodeMemberMethod)
+                               return GetCompatibleMethodsInClass (cls, 
(CodeMemberMethod) testMember);
+                       
+                       return new string[0];
+               }
+               
+               
+               public static bool IdentifierExistsInClass (IClass cls, string 
identifier)
+               {
+                       bool found = false;
+                       
+                       foreach (IMethod method in cls.Methods)
+                               if (method.Name == identifier)
+                                       found = true;
+                       
+                       foreach (IProperty property in cls.Properties)
+                               if (property.Name == identifier)
+                                       found = true;
+                       
+                       foreach (IEvent ev in cls.Events)
+                               if (ev.Name == identifier)
+                                       found = true;
+                       
+                       foreach (IField field in cls.Fields)
+                               if (field.Name == identifier)
+                                       found = true;
+                       
+                       return found;
+               }
+               
+               
+               public static string GenerateIdentifierUniqueInClass (IClass 
cls, string trialIdentifier)
+               {
+                       string trialValue = trialIdentifier;
+                       
+                       for (int suffix = 1; suffix <= int.MaxValue; suffix++)
+                       {
+                               if (!IdentifierExistsInClass (cls, trialValue))
+                                       return trialValue;
+                               
+                               trialValue = trialIdentifier + suffix.ToString 
();
+                       }
+                       
+                       throw new Exception ("Tried identifiers up to " + 
trialValue + " and all already existed");
+               }
+               
+               
+               //opens the code view with the desired method, creating it if 
it doesn't already exist
+               public static void CreateAndShowMember (IClass cls, 
CodeTypeMember member)
+               {
+                       //only adds the method if it doesn't already exist
+                       IMember mem = AddMemberToClass (cls, member, false);
+                       
+                       //FIXME: code refactorer returns a blank 
mem.Region.FileName and negative beginLine, so we can only jump to the class
+                       if (string.IsNullOrEmpty (mem.Region.FileName))
+                               Gtk.Application.Invoke ( delegate {
+                                       IdeApp.Workbench.OpenDocument 
(cls.Region.FileName, cls.Region.BeginLine, 1, true);
+                               });
+                       else
+                               Gtk.Application.Invoke ( delegate {
+                                       IdeApp.Workbench.OpenDocument 
(mem.Region.FileName, mem.Region.BeginLine, 1, true);
+                               });
+               }
+               
+               public static System.CodeDom.CodeTypeMember 
ReflectionToCodeDomMember (MemberInfo memberInfo)
+               {
+                       if (memberInfo is MethodInfo)
+                               return ReflectionToCodeDomMethod ((MethodInfo) 
memberInfo);
+                       
+                       throw new NotImplementedException ();
+               }
+               
+               public static System.CodeDom.CodeMemberMethod 
ReflectionToCodeDomMethod (MethodInfo mi)
+               {
+                       CodeMemberMethod newMethod = new CodeMemberMethod ();
+                       newMethod.Name = mi.Name;
+                       newMethod.ReturnType = new 
System.CodeDom.CodeTypeReference (mi.ReturnType.FullName);
+                       
+                       newMethod.Attributes = 
System.CodeDom.MemberAttributes.Private;
+                       switch (mi.Attributes) {
+                               case 
System.Reflection.MethodAttributes.Assembly:
+                                       newMethod.Attributes |= 
System.CodeDom.MemberAttributes.Assembly;
+                                       break;
+                               case 
System.Reflection.MethodAttributes.FamANDAssem:
+                                       newMethod.Attributes |= 
System.CodeDom.MemberAttributes.FamilyAndAssembly;
+                                       break;
+                               case System.Reflection.MethodAttributes.Family:
+                                       newMethod.Attributes |= 
System.CodeDom.MemberAttributes.Family;
+                                       break;
+                               case 
System.Reflection.MethodAttributes.FamORAssem:
+                                       newMethod.Attributes |= 
System.CodeDom.MemberAttributes.FamilyAndAssembly;
+                                       break;
+                               case System.Reflection.MethodAttributes.Public:
+                                       newMethod.Attributes |= 
System.CodeDom.MemberAttributes.Public;
+                                       break;
+                               case System.Reflection.MethodAttributes.Static:
+                                       newMethod.Attributes |= 
System.CodeDom.MemberAttributes.Static;
+                                       break;
+                       }
+                       
+                       ParameterInfo[] pinfos = mi.GetParameters ();
+                       foreach (ParameterInfo pi in pinfos) {
+                               CodeParameterDeclarationExpression newPar = new 
CodeParameterDeclarationExpression (pi.ParameterType.FullName, pi.Name);
+                               if (pi.IsIn) newPar.Direction = 
FieldDirection.In;
+                               if (pi.IsOut) newPar.Direction = 
FieldDirection.Out;
+                               newMethod.Parameters.Add (newPar);
+                       }
+                       
+                       return newMethod;
+               }
        }
 }

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindService.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindService.cs
       2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindService.cs
       2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,33 @@
+//
+// CodeBehindService.cs: Links codebehind classes to their parent files.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using System.Collections.Generic;

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DesignerSupportService.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DesignerSupportService.cs
  2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DesignerSupportService.cs
  2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// DesignerSupportService.cs: Service that provides facilities useful 
+//    for visual designers.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 
@@ -13,12 +44,7 @@
                PropertyPad propertyPad = null;
                ToolboxService toolboxService = null;
                CodeBehindService codeBehindService = new CodeBehindService ();
-               BindingService bindingService = new BindingService ();
                
-               public BindingService BindingService {
-                       get { return bindingService; }
-               }
-               
                #region PropertyPad
                
                public PropertyPad PropertyPad {

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs
   2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs
   2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// MemberExistsException.cs: Thrown if identifier already exists when 
+//    binding CodeBehind members.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
     2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
     2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// PropertyPad.cs: The pad that holds the MD property grid. Can also 
+//     hold custom grid widgets.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs
   2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs
   2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// RemoteDesignerProcess.cs: Base class for designer in remote process.
+//    Handles Gtk sockets and threads.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using Gtk;
@@ -50,13 +81,29 @@
                                        Application.Run ();
                                } catch (Exception e) {
                                        exceptionOccurred = true;
+                                       System.Console.WriteLine ("An exception 
occurred in the GUI thread");
                                        HandleError (e);
                                }
                        }
                }
                
-               public bool ExceptionOcurred
+               public bool ExecuteSuccessfully (EventHandler handler)
                {
+                       bool success = true;
+                       
+                       try {
+                               handler (null, EventArgs.Empty);
+                       } catch (Exception e) {
+                               exceptionOccurred = true;
+                               success = false;
+                               HandleError (e);
+                       }
+                       
+                       return success;
+               }
+               
+               public bool ExceptionOccurred
+               {
                        get { return exceptionOccurred; }
                }
                
@@ -67,7 +114,9 @@
                
                protected virtual void HandleError (Exception e)
                {
-                       ShowText ("<b><big>The designer has encountered a fatal 
error:</big></b>\n\n" + System.Web.HttpUtility.HtmlEncode (e.ToString ()));
+                       Gtk.Application.Invoke (delegate {
+                               ShowText ("<b><big>The designer has encountered 
a fatal error:</big></b>\n\n" + System.Web.HttpUtility.HtmlEncode (e.ToString 
()));
+                       });     
                }
                
                protected void ShowText (string markup)
@@ -160,13 +209,22 @@
                
                #endregion plugs
                
+               bool disposed = false;
                public override void Dispose ()
                {
-                       //kill the GUI thread
+                       if (disposed)
+                               return;
+                       disposed = true;
+                       
+                       System.Diagnostics.Trace.WriteLine ("Trying to close 
designer GUI thread");
                        Application.Invoke ( delegate {
                                Application.Quit ();
+                               DisposePhase2 ();
                        });
-                       
+               }
+               
+               void DisposePhase2 ()
+               {
                        //clean up widgets
                        if (designerPlug != null)
                                designerPlug.Dispose ();

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
      2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
      2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,33 @@
+//
+// ToolboxPad.cs: The pad that hold the MD toolbox.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 
@@ -4,18 +34,18 @@
 using MonoDevelop.Ide.Gui;
 
 using MonoDevelop.DesignerSupport;
-using tb = MonoDevelop.DesignerSupport.Toolbox;
+using MonoDevelop.DesignerSupport.Toolbox;
 
 namespace MonoDevelop.DesignerSupport
 {
        
        public class ToolboxPad : AbstractPadContent
        {
-               tb.Toolbox toolbox;
+               Toolbox.Toolbox toolbox;
                
                public ToolboxPad ()  : base ("")
                {
-                       toolbox = new tb.Toolbox 
(DesignerSupport.Service.ToolboxService);
+                       toolbox = new Toolbox.Toolbox 
(DesignerSupport.Service.ToolboxService);
                }
                
                #region AbstractPadContent implementations

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
  2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
  2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,33 @@
+//
+// ToolboxService.cs: Loads, stores and manipulates toolbox items.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using System.IO;
@@ -119,23 +149,37 @@
                
                public IList GetCurrentToolboxItems ()
                {
-                       return GetToolboxItems (currentConsumer);
+                       return GetToolboxItems (CurrentConsumer);
                }
                
                public IList GetToolboxItems (IToolboxConsumer consumer)
                {
-                       ArrayList arr = new ArrayList ();
+                       List<ItemToolboxNode> arr = new List<ItemToolboxNode> 
();
                        
-                       if (consumer != null)
+                       if (consumer != null) {
                                foreach (ItemToolboxNode node in allItems)
-                                       if (IsSupported (node, consumer))
+                                       //hide unknown nodes --
+                                       //they're only there because 
deserialisation has failed, so they won't actaully be usable
+                                       if ( !(node is UnknownToolboxNode))
+                                               if (IsSupported (node, 
consumer))
+                                                       arr.Add (node);
+                               
+                               //merge the list of dynamic items
+                               IList<ItemToolboxNode> dynamicItems = 
consumer.GetDynamicItems ();
+                               if (dynamicItems != null)
+                                       foreach (ItemToolboxNode node in 
dynamicItems)
                                                arr.Add (node);
+                       }
                        
                        return arr;
                }
                
                public IToolboxConsumer CurrentConsumer {
                        get { return currentConsumer; }
+                       private set {
+                               currentConsumer = value;                        
        
+                               OnToolboxConsumerChanged (currentConsumer);
+                       }
                }
                
                public ItemToolboxNode SelectedItem {
@@ -150,11 +194,11 @@
                
                public void UseSelectedItem ()
                {
-                       if ((currentConsumer == null) || (selectedItem == null))
+                       if ((CurrentConsumer == null) || (selectedItem == null))
                                return;
                        
-                       currentConsumer.Use (selectedItem);
-                       OnToolboxUsed (currentConsumer, selectedItem);
+                       CurrentConsumer.ConsumeItem (selectedItem);
+                       OnToolboxUsed (CurrentConsumer, selectedItem);
                }
                
                #endregion
@@ -177,11 +221,9 @@
                {
                        //only treat active ViewContent as a Toolbox consumer 
if it implements IToolboxConsumer
                        if (IdeApp.Workbench.ActiveDocument != null)
-                               currentConsumer = 
IdeApp.Workbench.ActiveDocument.ActiveView as IToolboxConsumer;
+                               CurrentConsumer = 
IdeApp.Workbench.ActiveDocument.ActiveView as IToolboxConsumer;
                        else
-                               currentConsumer = null;
-                       
-                       OnToolboxConsumerChanged (currentConsumer);
+                               CurrentConsumer = null;
                }
                
                protected virtual void OnToolboxContentsChanged ()

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
       2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
       2006-08-05 16:06:02 UTC (rev 63389)
@@ -101,6 +101,7 @@
                        content.ContentChanged -= new EventHandler 
(OnTextContentChanged);
                        content.DirtyChanged -= new EventHandler 
(OnTextDirtyChanged);
                        IdeApp.Workbench.ActiveDocumentChanged -= new 
EventHandler (OnActiveDocumentChanged);
+                       content.Dispose ();
                        base.Dispose ();
                }
                

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs
     2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs
     2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// CodeBehindDisplayBinding.cs: Attaches secondary view of CodeBehind files.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
 using System;
 
 using MonoDevelop.Ide;
@@ -16,6 +47,11 @@
                        IClass cls = GetCodeBehindClass (content);
                        
                        if (cls != null) {
+                               //don't attach if file is already open
+                               foreach (Document doc in 
IdeApp.Workbench.Documents)
+                                       if (doc.FileName == cls.Region.FileName)
+                                               return false;
+                               
                                IDisplayBinding db = 
IdeApp.Workbench.DisplayBindings.GetBindingPerFileName (cls.Region.FileName);
                                if (db != null)
                                        return true;
@@ -31,7 +67,10 @@
                                throw new Exception ("Cannot create CodeBehind 
binding for " + viewContent.ContentName + ".");
                        
                        IDisplayBinding db = 
IdeApp.Workbench.DisplayBindings.GetBindingPerFileName (cls.Region.FileName);
-                       return new CodeBehindViewContent 
(db.CreateContentForFile (cls.Region.FileName));
+                       IViewContent vc = db.CreateContentForFile 
(cls.Region.FileName);
+                       vc.Load (cls.Region.FileName);
+                       
+                       return new CodeBehindViewContent (vc);
                }
                
                IClass GetCodeBehindClass (IViewContent content)

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs
  2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs
  2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// ICodeBehindProvider.cs: Interface for classes that can link codebehind 
+//    classes to their 'parent' file.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using System.Collections.Generic;
@@ -11,6 +42,7 @@
        {
                //return null if there's an error, or the project or file is 
unsupported
                IClass GetCodeBehind (ProjectFile file);
+               
                IList<IClass> GetAllCodeBehindClasses (Project project);
        }
 }

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs
        2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs
        2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,5 +1,36 @@
+//
+// IToolboxConsumer.cs: Interface for classes that can use toolbox items.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
+using System.Collections.Generic;
 
 namespace MonoDevelop.DesignerSupport.Toolbox
 {
@@ -7,13 +38,19 @@
        public interface IToolboxConsumer
        {
                /*todo: drag/drop stuff */
-               void Use (ItemToolboxNode item);
                
-               //used to filter toolbox items
+               //This is run when an item is activated from the toolbox 
service.
+               void ConsumeItem (ItemToolboxNode item);
+               
+               //Toolbox service uses this to filter toolbox items.
                System.ComponentModel.ToolboxItemFilterAttribute[] 
ToolboxFilterAttributes {
                        get;
                }
                
+               //Consumer can provide items specific to this designer instance,
+               //and they will not be persisted. Return null if not using this 
feature.
+               IList<ItemToolboxNode> GetDynamicItems ();
+               
                //Used if ToolboxItemFilterAttribute demands 
ToolboxItemFilterType.Custom
                //If not expecting it, should just return false
                bool CustomFilterSupports (ItemToolboxNode item);

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs
  2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs
  2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// IToolboxLoader.cs: Interface for classes that can load toolbox 
+//    nodes from a file.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs
        2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs
        2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// ToolboxItemToolboxLoader.cs: A toolbox loader that loads the standard 
+//   .NET Framework ToolboxItems from assemblies.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using System.Collections.Generic;

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/UnknownToolboxNode.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/UnknownToolboxNode.cs
      2006-08-05 14:55:49 UTC (rev 63388)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/UnknownToolboxNode.cs
      2006-08-05 16:06:02 UTC (rev 63389)
@@ -1,3 +1,34 @@
+//
+// UnknownToolboxNode.cs: Fallback toolbox node for when deserialiser 
+//   cannot find the actual class.
+//
+// Authors:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using System.Collections;

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

Reply via email to