Search Results for

    Show / Hide Table of Contents

    Class SourceText

    Inheritance
    object
    SourceText
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Microsoft.CodeAnalysis.Text
    Assembly: Microsoft.CodeAnalysis.dll
    Syntax
    public abstract class SourceText

    Constructors

    SourceText(ImmutableArray<byte>, SourceHashAlgorithm, SourceTextContainer?)

    Declaration
    protected SourceText(ImmutableArray<byte> checksum = default, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1, SourceTextContainer? container = null)
    Parameters
    Type Name Description
    ImmutableArray<byte> checksum
    SourceHashAlgorithm checksumAlgorithm
    SourceTextContainer container

    Properties

    CanBeEmbedded

    Declaration
    public bool CanBeEmbedded { get; }
    Property Value
    Type Description
    bool

    ChecksumAlgorithm

    Declaration
    public SourceHashAlgorithm ChecksumAlgorithm { get; }
    Property Value
    Type Description
    SourceHashAlgorithm

    Container

    Declaration
    public virtual SourceTextContainer Container { get; }
    Property Value
    Type Description
    SourceTextContainer

    Encoding

    Declaration
    public abstract Encoding? Encoding { get; }
    Property Value
    Type Description
    Encoding

    this[int]

    Declaration
    public abstract char this[int position] { get; }
    Parameters
    Type Name Description
    int position
    Property Value
    Type Description
    char

    Length

    Declaration
    public abstract int Length { get; }
    Property Value
    Type Description
    int

    Lines

    Declaration
    public TextLineCollection Lines { get; }
    Property Value
    Type Description
    TextLineCollection

    Methods

    ContentEquals(SourceText)

    Declaration
    public bool ContentEquals(SourceText other)
    Parameters
    Type Name Description
    SourceText other
    Returns
    Type Description
    bool

    ContentEqualsImpl(SourceText)

    Declaration
    protected virtual bool ContentEqualsImpl(SourceText other)
    Parameters
    Type Name Description
    SourceText other
    Returns
    Type Description
    bool

    CopyTo(int, char[], int, int)

    Declaration
    public abstract void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count)
    Parameters
    Type Name Description
    int sourceIndex
    char[] destination
    int destinationIndex
    int count

    From(byte[], int, Encoding?, SourceHashAlgorithm, bool, bool)

    Declaration
    public static SourceText From(byte[] buffer, int length, Encoding? encoding = null, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1, bool throwIfBinaryDetected = false, bool canBeEmbedded = false)
    Parameters
    Type Name Description
    byte[] buffer
    int length
    Encoding encoding
    SourceHashAlgorithm checksumAlgorithm
    bool throwIfBinaryDetected
    bool canBeEmbedded
    Returns
    Type Description
    SourceText

    From(Stream, Encoding?, SourceHashAlgorithm, bool, bool)

    Declaration
    public static SourceText From(Stream stream, Encoding? encoding = null, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1, bool throwIfBinaryDetected = false, bool canBeEmbedded = false)
    Parameters
    Type Name Description
    Stream stream
    Encoding encoding
    SourceHashAlgorithm checksumAlgorithm
    bool throwIfBinaryDetected
    bool canBeEmbedded
    Returns
    Type Description
    SourceText

    From(TextReader, int, Encoding?, SourceHashAlgorithm)

    Declaration
    public static SourceText From(TextReader reader, int length, Encoding? encoding = null, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1)
    Parameters
    Type Name Description
    TextReader reader
    int length
    Encoding encoding
    SourceHashAlgorithm checksumAlgorithm
    Returns
    Type Description
    SourceText

    From(string, Encoding?, SourceHashAlgorithm)

    Declaration
    public static SourceText From(string text, Encoding? encoding = null, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1)
    Parameters
    Type Name Description
    string text
    Encoding encoding
    SourceHashAlgorithm checksumAlgorithm
    Returns
    Type Description
    SourceText

    GetChangeRanges(SourceText)

    Declaration
    public virtual IReadOnlyList<TextChangeRange> GetChangeRanges(SourceText oldText)
    Parameters
    Type Name Description
    SourceText oldText
    Returns
    Type Description
    IReadOnlyList<TextChangeRange>

    GetChecksum()

    Declaration
    public ImmutableArray<byte> GetChecksum()
    Returns
    Type Description
    ImmutableArray<byte>

    GetContentHash()

    Declaration
    public ImmutableArray<byte> GetContentHash()
    Returns
    Type Description
    ImmutableArray<byte>

    GetLinesCore()

    Declaration
    protected virtual TextLineCollection GetLinesCore()
    Returns
    Type Description
    TextLineCollection

    GetSubText(TextSpan)

    Declaration
    public virtual SourceText GetSubText(TextSpan span)
    Parameters
    Type Name Description
    TextSpan span
    Returns
    Type Description
    SourceText

    GetSubText(int)

    Declaration
    public SourceText GetSubText(int start)
    Parameters
    Type Name Description
    int start
    Returns
    Type Description
    SourceText

    GetTextChanges(SourceText)

    Declaration
    public virtual IReadOnlyList<TextChange> GetTextChanges(SourceText oldText)
    Parameters
    Type Name Description
    SourceText oldText
    Returns
    Type Description
    IReadOnlyList<TextChange>

    Replace(TextSpan, string)

    Declaration
    public SourceText Replace(TextSpan span, string newText)
    Parameters
    Type Name Description
    TextSpan span
    string newText
    Returns
    Type Description
    SourceText

    Replace(int, int, string)

    Declaration
    public SourceText Replace(int start, int length, string newText)
    Parameters
    Type Name Description
    int start
    int length
    string newText
    Returns
    Type Description
    SourceText

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    ToString(TextSpan)

    Declaration
    public virtual string ToString(TextSpan span)
    Parameters
    Type Name Description
    TextSpan span
    Returns
    Type Description
    string

    WithChanges(params TextChange[])

    Declaration
    public SourceText WithChanges(params TextChange[] changes)
    Parameters
    Type Name Description
    TextChange[] changes
    Returns
    Type Description
    SourceText

    WithChanges(IEnumerable<TextChange>)

    Declaration
    public virtual SourceText WithChanges(IEnumerable<TextChange> changes)
    Parameters
    Type Name Description
    IEnumerable<TextChange> changes
    Returns
    Type Description
    SourceText

    Write(TextWriter, TextSpan, CancellationToken)

    Declaration
    public virtual void Write(TextWriter writer, TextSpan span, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TextWriter writer
    TextSpan span
    CancellationToken cancellationToken

    Write(TextWriter, CancellationToken)

    Declaration
    public void Write(TextWriter textWriter, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TextWriter textWriter
    CancellationToken cancellationToken
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0