~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
Import upstream version 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
using MonoDevelop.Ide.Gui.Content;
34
34
using MonoDevelop.Ide.Gui;
 
35
using MonoDevelop.Projects;
 
36
using MonoDevelop.Projects.Text;
35
37
 
36
38
namespace MonoDevelop.Ide.Navigation
37
39
{
250
252
                        
251
253
                        currentDoc.Closed += HandleCurrentDocClosed;
252
254
                        
253
 
                        if (currentDoc.TextEditor != null) {
254
 
                                currentDoc.TextEditor.TextChanged += BufferTextChanged;
255
 
                                currentDoc.TextEditor.CursorPositionChanged += BufferCaretPositionChanged;
 
255
                        if (currentDoc.Editor != null) {
 
256
                                currentDoc.Editor.Document.TextReplaced += BufferTextChanged;
 
257
                                currentDoc.Editor.Caret.PositionChanged += BufferCaretPositionChanged;
256
258
                        }
257
259
                }
258
260
 
267
269
                                return;
268
270
                        
269
271
                        currentDoc.Closed -= HandleCurrentDocClosed;
270
 
                        if (currentDoc.TextEditor != null) {
271
 
                                currentDoc.TextEditor.TextChanged -= BufferTextChanged;
272
 
                                currentDoc.TextEditor.CursorPositionChanged -= BufferCaretPositionChanged;
 
272
                        if (currentDoc.Editor != null) {
 
273
                                currentDoc.Editor.Document.TextReplaced -= BufferTextChanged;
 
274
                                currentDoc.Editor.Caret.PositionChanged -= BufferCaretPositionChanged;
273
275
                        }
274
276
                        currentDoc = null;
275
277
                }
279
281
                        LogActiveDocument (true);
280
282
                }
281
283
                
282
 
                static void BufferTextChanged (object sender, TextChangedEventArgs args)
 
284
                static void BufferTextChanged (object sender, EventArgs args)
283
285
                {
284
286
                        LogActiveDocument ();
285
287
                }
288
290
                
289
291
                #region Text file line number and snippet updating
290
292
                
291
 
                static void LineCountChanged (object sender, MonoDevelop.Projects.Text.LineCountEventArgs args)
292
 
                {
293
 
//                      MonoDevelop.Projects.Text.ITextFile textFile = (MonoDevelop.Projects.Text.ITextFile) sender;
294
 
                }
295
 
                
296
 
                static void CommitCountChanges (object sender, MonoDevelop.Projects.Text.TextFileEventArgs args)
297
 
                {
298
 
//                      MonoDevelop.Projects.Text.ITextFile textFile = (MonoDevelop.Projects.Text.ITextFile) sender;
299
 
                }
300
 
                
301
 
                static void ResetCountChanges (object sender, MonoDevelop.Projects.Text.TextFileEventArgs args)
302
 
                {
303
 
//                      MonoDevelop.Projects.Text.ITextFile textFile = (MonoDevelop.Projects.Text.ITextFile) sender;
304
 
                }
305
 
                
306
 
                static void FileRenamed (object sender, MonoDevelop.Projects.ProjectFileRenamedEventArgs args)
 
293
                static void LineCountChanged (object sender, LineCountEventArgs args)
 
294
                {
 
295
//                      MonoDevelop.Projects.Text.ITextFile textFile = (MonoDevelop.Projects.Text.ITextFile) sender;
 
296
                }
 
297
                
 
298
                static void CommitCountChanges (object sender, TextFileEventArgs args)
 
299
                {
 
300
//                      MonoDevelop.Projects.Text.ITextFile textFile = (MonoDevelop.Projects.Text.ITextFile) sender;
 
301
                }
 
302
                
 
303
                static void ResetCountChanges (object sender, TextFileEventArgs args)
 
304
                {
 
305
//                      MonoDevelop.Projects.Text.ITextFile textFile = (MonoDevelop.Projects.Text.ITextFile) sender;
 
306
                }
 
307
                
 
308
                static void FileRenamed (object sender, ProjectFileRenamedEventArgs e)
307
309
                {
308
310
                        bool changed = false;
309
 
                        foreach (NavigationHistoryItem point in history) {
310
 
                                DocumentNavigationPoint dp = point.NavigationPoint as DocumentNavigationPoint;
311
 
                                changed &= (dp != null && dp.HandleRenameEvent (args.OldName, args.NewName));
 
311
                        foreach (ProjectFileRenamedEventInfo args in e) {
 
312
                                foreach (NavigationHistoryItem point in history) {
 
313
                                        DocumentNavigationPoint dp = point.NavigationPoint as DocumentNavigationPoint;
 
314
                                        changed &= (dp != null && dp.HandleRenameEvent (args.OldName, args.NewName));
 
315
                                }
312
316
                        }
313
317
                        if (changed)
314
318
                                OnHistoryChanged ();