Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/XmlEditor@4192 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
17 changed files with 271 additions and 137 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,24 +0,0 @@
@@ -1,24 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision: 2498 $</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.TextEditor.Document; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace XmlEditor.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Helper class that implements the Text Editor library's IDocument interface.
|
||||
/// </summary>
|
||||
public class MockDocument |
||||
{ |
||||
public static IDocument Create() |
||||
{ |
||||
return new DocumentFactory().CreateDocument(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,83 @@
@@ -0,0 +1,83 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Editor; |
||||
using System.Windows.Media; |
||||
|
||||
namespace XmlEditor.Tests.Utils |
||||
{ |
||||
public class MockTextMarker : ITextMarker |
||||
{ |
||||
public event EventHandler Deleted; |
||||
|
||||
List<ITextMarker> markers; |
||||
int start, end, length; |
||||
|
||||
public MockTextMarker(List<ITextMarker> markers, int start, int end, int length) |
||||
{ |
||||
this.markers = markers; |
||||
this.start = start; |
||||
this.end = end; |
||||
this.length = length; |
||||
} |
||||
|
||||
public int StartOffset { |
||||
get { |
||||
return this.start; |
||||
} |
||||
} |
||||
|
||||
public int EndOffset { |
||||
get { |
||||
return this.end; |
||||
} |
||||
} |
||||
|
||||
public int Length { |
||||
get { |
||||
return this.length; |
||||
} |
||||
} |
||||
|
||||
public bool IsDeleted { |
||||
get { |
||||
return !markers.Contains(this); |
||||
} |
||||
} |
||||
|
||||
public Nullable<Color> BackgroundColor { |
||||
get { |
||||
return null; |
||||
} |
||||
set { |
||||
} |
||||
} |
||||
|
||||
public Nullable<Color> ForegroundColor { |
||||
get { |
||||
return null; |
||||
} |
||||
set { |
||||
} |
||||
} |
||||
|
||||
public object Tag { |
||||
get { |
||||
return null; |
||||
} |
||||
set { |
||||
} |
||||
} |
||||
|
||||
public void Delete() |
||||
{ |
||||
this.markers.Remove(this); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Editor; |
||||
using System.Windows.Media; |
||||
|
||||
namespace XmlEditor.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Description of MockTextEditor.
|
||||
/// </summary>
|
||||
public class MockTextMarkerService : ITextMarkerService |
||||
{ |
||||
List<ITextMarker> markers; |
||||
|
||||
public MockTextMarkerService() |
||||
{ |
||||
this.markers = new List<ITextMarker>(); |
||||
} |
||||
|
||||
public System.Collections.Generic.IEnumerable<ITextMarker> TextMarkers { |
||||
get { |
||||
return this.markers; |
||||
} |
||||
} |
||||
|
||||
public ITextMarker Create(int startOffset, int length) |
||||
{ |
||||
ITextMarker m = new MockTextMarker(this.markers, startOffset, startOffset + length, length); |
||||
this.markers.Add(m); |
||||
return m; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue