[Monodevelop-patches-list] r946 - trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Thu Feb 19 14:33:19 EST 2004
Author: tberman
Date: 2004-02-19 14:33:19 -0500 (Thu, 19 Feb 2004)
New Revision: 946
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/AllOpenDocumentIterator.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/DirectoryDocumentIterator.cs
Log:
fixing up two of the document iterators, now find in all open files should work.
please note, im AWARE my finding impl is ass slow, its easy to debug, ill speed it up once i get find/replace working slowly :)
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/AllOpenDocumentIterator.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/AllOpenDocumentIterator.cs 2004-02-19 19:20:58 UTC (rev 945)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/AllOpenDocumentIterator.cs 2004-02-19 19:33:19 UTC (rev 946)
@@ -11,6 +11,8 @@
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.TextEditor;
+using MonoDevelop.SourceEditor.Gui;
+
namespace ICSharpCode.TextEditor.Document
{
public class AllOpenDocumentIterator : IDocumentIterator
@@ -42,10 +44,9 @@
if (!SearchReplaceUtilities.IsTextAreaSelected) {
return null;
}
- //IDocument document = (((ITextEditorControlProvider)WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent).TextEditorControl).Document;
- //return new ProvidedDocumentInformation(document,
- // CurrentFileName);
- return null;
+ SourceEditor document = (SourceEditor) (((SourceEditorDisplayBindingWrapper)WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent).Control);
+ return new ProvidedDocumentInformation(document,
+ CurrentFileName);
}
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/DirectoryDocumentIterator.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/DirectoryDocumentIterator.cs 2004-02-19 19:20:58 UTC (rev 945)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Search/DocumentIterator/DirectoryDocumentIterator.cs 2004-02-19 19:33:19 UTC (rev 946)
@@ -16,6 +16,8 @@
using ICSharpCode.SharpDevelop.Services;
using ICSharpCode.TextEditor;
+using MonoDevelop.SourceEditor.Gui;
+
namespace ICSharpCode.TextEditor.Document
{
public class DirectoryDocumentIterator : IDocumentIterator
@@ -48,27 +50,27 @@
public ProvidedDocumentInformation Current {
get {
- /*if (curIndex < 0 || curIndex >= files.Count) {
+ if (curIndex < 0 || curIndex >= files.Count) {
return null;
}
if (!File.Exists(files[curIndex].ToString())) {
++curIndex;
return Current;
}
- IDocument document;
+ SourceEditor document;
string fileName = files[curIndex].ToString();
foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
// WINDOWS DEPENDENCY : ToUpper
if (content.ContentName != null &&
content.ContentName.ToUpper() == fileName.ToUpper()) {
- document = ((ITextEditorControlProvider)content).TextEditorControl.Document;
+ document = (SourceEditor) ((SourceEditorDisplayBindingWrapper)content).Control;
return new ProvidedDocumentInformation(document,
fileName);
}
}
- ITextBufferStrategy strategy = null;
+ SourceEditorBuffer strategy = null;
try {
- strategy = StringTextBufferStrategy.CreateTextBufferFromFile(fileName);
+ strategy = SourceEditorBuffer.CreateTextBufferFromFile(fileName);
} catch (Exception) {
TaskService taskService = (TaskService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(TaskService));
taskService.Tasks.Add(new Task(String.Empty, "can't access " + fileName, -1, -1));
@@ -77,8 +79,6 @@
return new ProvidedDocumentInformation(strategy,
fileName,
0);
- */
- return null;
}
}
More information about the Monodevelop-patches-list
mailing list