C# Class Acrolinx.Sdk.Sidebar.Util.Adapter.UniversalAdapter

UniversalAdapter provides functionality to adjust offsets based on actions performed by the sidebar and the user. It can be used for XML as well as plain text.
Inheritance: IAdapter
Show file Open project: acrolinx/acrolinx-sidebar-demo-dotnet

Private Properties

Property Type Description
DecodeIfRequried string
DecodedLength int
EncodeIfRequried string
ToRawRange IRange

Public Methods

Method Description
CreateXElement ( ) : System.Xml.Linq.XElement
Extract ( System.Text.Format format ) : string
ReplaceRanges ( IReadOnlyList matches, DocumentModel model, System.Text.Format format ) : void
SelectRanges ( IReadOnlyList matches, DocumentModel model, System.Text.Format format ) : void
UniversalAdapter ( string tagName, bool encodeContent ) : System

Protected Methods

Method Description
ExtractRaw ( ) : string
ReplaceRawRange ( IRange range, string replacement, System.Text.Format format ) : void
SelectRawRange ( IRange range, System.Text.Format format ) : void
XmlDecode ( string xml ) : string
XmlEncode ( string text ) : string

Private Methods

Method Description
DecodeIfRequried ( string text, System.Text.Format format ) : string
DecodedLength ( string text ) : int
EncodeIfRequried ( string text, System.Text.Format format ) : string
ToRawRange ( System.Text.Format format, string currentExtraction, IRange rangeWithTag, bool silent ) : IRange

Method Details

CreateXElement() public method

public CreateXElement ( ) : System.Xml.Linq.XElement
return System.Xml.Linq.XElement

Extract() public method

public Extract ( System.Text.Format format ) : string
format System.Text.Format
return string

ExtractRaw() protected abstract method

protected abstract ExtractRaw ( ) : string
return string

ReplaceRanges() public method

public ReplaceRanges ( IReadOnlyList matches, DocumentModel model, System.Text.Format format ) : void
matches IReadOnlyList
model Acrolinx.Sdk.Sidebar.Util.Changetracking.DocumentModel
format System.Text.Format
return void

ReplaceRawRange() protected method

protected ReplaceRawRange ( IRange range, string replacement, System.Text.Format format ) : void
range IRange
replacement string
format System.Text.Format
return void

SelectRanges() public method

public SelectRanges ( IReadOnlyList matches, DocumentModel model, System.Text.Format format ) : void
matches IReadOnlyList
model Acrolinx.Sdk.Sidebar.Util.Changetracking.DocumentModel
format System.Text.Format
return void

SelectRawRange() protected method

protected SelectRawRange ( IRange range, System.Text.Format format ) : void
range IRange
format System.Text.Format
return void

UniversalAdapter() public method

public UniversalAdapter ( string tagName, bool encodeContent ) : System
tagName string
encodeContent bool
return System

XmlDecode() protected method

protected XmlDecode ( string xml ) : string
xml string
return string

XmlEncode() protected method

protected XmlEncode ( string text ) : string
text string
return string