示例#1
0
 /// <summary>
 /// Creates a snapshot of the current text.
 /// </summary>
 /// <remarks>
 /// <para>This method returns an immutable snapshot of the document, and may be safely called even when
 /// the document's owner thread is concurrently modifying the document.
 /// </para><para>
 /// This special thread-safety guarantee is valid only for TextDocument.CreateSnapshot(), not necessarily for other
 /// classes implementing ITextSource.CreateSnapshot().
 /// </para><para>
 /// </para>
 /// </remarks>
 public ITextSource CreateSnapshot()
 {
     lock (lockObject)
     {
         return(new RopeTextSource(rope.Clone()));
     }
 }
示例#2
0
		/// <summary>
		/// Creates a new RopeTextSource.
		/// </summary>
		public RopeTextSource(Rope<char> rope, ITextSourceVersion version)
		{
			if (rope == null)
				throw new ArgumentNullException("rope");
			this.rope = rope.Clone();
			this.version = version;
		}
 /// <summary>
 /// Creates a new RopeTextSource.
 /// </summary>
 public RopeTextSource(Rope <char> rope)
 {
     if (rope == null)
     {
         throw new ArgumentNullException("rope");
     }
     this.rope = rope.Clone();
 }
 /// <summary>
 /// Creates a new RopeTextSource.
 /// </summary>
 public RopeTextSource(Rope <char> rope, ITextSourceVersion version)
 {
     if (rope == null)
     {
         throw new ArgumentNullException("rope");
     }
     this.rope    = rope.Clone();
     this.version = version;
 }
 public Rope <char> GetRope()
 {
     return(rope.Clone());
 }
示例#6
0
		/// <summary>
		/// Creates a new RopeTextSource.
		/// </summary>
		public RopeTextSource(Rope<char> rope)
		{
			if (rope == null)
				throw new ArgumentNullException("rope");
			this.rope = rope.Clone();
		}
示例#7
0
 /// <summary>
 /// Creates a new RopeTextSource.
 /// </summary>
 public RopeTextSource(Rope <char> rope, ITextSourceVersion version)
 {
     _rope   = rope?.Clone() ?? throw new ArgumentNullException(nameof(rope));
     Version = version;
 }
示例#8
0
 /// <summary>
 /// Creates a new RopeTextSource.
 /// </summary>
 public RopeTextSource(Rope <char> rope)
 {
     _rope = rope?.Clone() ?? throw new ArgumentNullException(nameof(rope));
 }