Author: mhutch
Date: 2007-09-20 11:56:57 -0400 (Thu, 20 Sep 2007)
New Revision: 86069

Added:
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs
Modified:
   trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/ChangeLog
   trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/Makefile.am
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.mdp
   
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
Log:
* MonoDevelop.DesignerSupport.mdp,
  MonoDevelop.DesignerSupport/BindingService.cs,
  MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs,
  Makefile.am: Make OpenDocumentFileProvider publicly accessible so
  it can be used elsewhere.

Modified: trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/ChangeLog      
2007-09-20 15:56:49 UTC (rev 86068)
+++ trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/ChangeLog      
2007-09-20 15:56:57 UTC (rev 86069)
@@ -1,3 +1,11 @@
+2007-09-20  Michael Hutchinson <[EMAIL PROTECTED]> 
+
+       * MonoDevelop.DesignerSupport.mdp,
+         MonoDevelop.DesignerSupport/BindingService.cs,
+         MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs, Makefile.am:
+         Make OpenDocumentFileProvider publicly accessible so it can be used
+         elsewhere.
+
 2007-09-19  Michael Hutchinson <[EMAIL PROTECTED]> 
 
        * MonoDevelop.DesignerSupport.mdp,

Modified: trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/Makefile.am
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/Makefile.am    
2007-09-20 15:56:49 UTC (rev 86068)
+++ trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/Makefile.am    
2007-09-20 15:56:57 UTC (rev 86069)
@@ -86,6 +86,7 @@
        MonoDevelop.DesignerSupport/DesignerSupportService.cs \
        MonoDevelop.DesignerSupport/IPropertyProvider.cs \
        MonoDevelop.DesignerSupport/MemberExistsException.cs \
+       MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs \
        MonoDevelop.DesignerSupport/PropertyPad.cs \
        MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs \
        MonoDevelop.DesignerSupport/ToolboxPad.cs \

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
  2007-09-20 15:56:49 UTC (rev 86068)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
  2007-09-20 15:56:57 UTC (rev 86069)
@@ -48,8 +48,6 @@
                //TODO: currently case-sensitive, so some languages may not 
like this
                const bool ignoreCase = false;
                
-               private static ITextFileProvider openedFileProvider = new 
OpenDocumentFileProvider ();
-               
                private BindingService ()
                {
                }
@@ -137,26 +135,10 @@
                public static CodeRefactorer GetCodeGenerator ()
                {                       
                        CodeRefactorer cr = new CodeRefactorer 
(IdeApp.ProjectOperations.CurrentOpenCombine, 
IdeApp.ProjectOperations.ParserDatabase);
-                       cr.TextFileProvider = openedFileProvider;
+                       cr.TextFileProvider = OpenDocumentFileProvider.Instance;
                        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.GetContent<IEditableTextFile> ();
-                                               if (ef != null) return ef;
-                                       }
-                               }
-                               return null;
-                       }
-               }
-               
                //TODO: check accessibility
                public static string[] GetCompatibleMethodsInClass (IClass cls, 
CodeMemberMethod testMethod)
                {

Added: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs
        2007-09-20 15:56:49 UTC (rev 86068)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs
        2007-09-20 15:56:57 UTC (rev 86069)
@@ -0,0 +1,60 @@
+// OpenDocumentFileProvider.cs
+// 
+// Author:
+//   Michael Hutchinson <[EMAIL PROTECTED]>
+// 
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+// 
+// 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.Projects.Text;
+using MonoDevelop.Ide.Gui;
+
+namespace MonoDevelop.DesignerSupport
+{
+       
+       //copied from MonoDevelop.GtkCore.GuiBuilder
+       public class OpenDocumentFileProvider: ITextFileProvider
+       {
+               static OpenDocumentFileProvider instance;
+               
+               public static OpenDocumentFileProvider Instance {
+                       get {
+                               if (instance == null)
+                                       instance = new OpenDocumentFileProvider 
();
+                               return instance;
+                       }
+               }
+               
+               public IEditableTextFile GetEditableTextFile (string filePath)
+               {
+                       foreach (Document doc in IdeApp.Workbench.Documents) {
+                               //FIXME: look in other views
+                               if (doc.FileName == filePath) {
+                                       IEditableTextFile ef = 
doc.GetContent<IEditableTextFile> ();
+                                       if (ef != null) return ef;
+                               }
+                       }
+                       return null;
+               }
+       }
+}

Modified: 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.mdp
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.mdp
        2007-09-20 15:56:49 UTC (rev 86068)
+++ 
trunk/monodevelop/Extras/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.mdp
        2007-09-20 15:56:57 UTC (rev 86069)
@@ -93,6 +93,7 @@
     <File 
name="./MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs" 
subtype="Code" buildaction="Compile" />
     <File 
name="./MonoDevelop.DesignerSupport.CodeBehind/CodeBehindClassEventArgs.cs" 
subtype="Code" buildaction="Compile" />
     <File name="./MonoDevelop.DesignerSupport.CodeBehind/CodeBehindClass.cs" 
subtype="Code" buildaction="Compile" />
+    <File name="./MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs" 
subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="False" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

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

Reply via email to