C# Class ICSharpCode.NRefactory.CSharp.CacheIndentEngine

Represents a decorator of an IStateMachineIndentEngine instance that provides logic for reseting and updating the engine on text changed events.
The decorator is based on periodical caching of the engine's state and delegating all logic behind indentation to the currently active engine.
Inheritance: IStateMachineIndentEngine
Exibir arquivo Open project: 0xd4d/NRefactory Class Usage Examples

Public Methods

Method Description
CacheIndentEngine ( CacheIndentEngine prototype ) : ICSharpCode.NRefactory.Editor

Creates a new CacheIndentEngine instance from the given prototype.

CacheIndentEngine ( IStateMachineIndentEngine decoratedEngine, int cacheRate = 2000 ) : ICSharpCode.NRefactory.Editor

Creates a new CacheIndentEngine instance.

Clone ( ) : IStateMachineIndentEngine
GetEngine ( int offset ) : IStateMachineIndentEngine
Push ( char ch ) : void
Reset ( ) : void
ResetEngineToPosition ( int offset ) : void

Resets the engine to offset. Clears all cached engines after the given offset.

Update ( int position ) : void If the position is negative, the engine will update to: document.TextLength + (offset % document.TextLength+1) Otherwise it will update to: offset % document.TextLength+1

Private Methods

Method Description
ICloneable ( ) : object
IDocumentIndentEngine ( ) : IDocumentIndentEngine

Method Details

CacheIndentEngine() public method

Creates a new CacheIndentEngine instance from the given prototype.
public CacheIndentEngine ( CacheIndentEngine prototype ) : ICSharpCode.NRefactory.Editor
prototype CacheIndentEngine /// A CacheIndentEngine instance. ///
return ICSharpCode.NRefactory.Editor

CacheIndentEngine() public method

Creates a new CacheIndentEngine instance.
public CacheIndentEngine ( IStateMachineIndentEngine decoratedEngine, int cacheRate = 2000 ) : ICSharpCode.NRefactory.Editor
decoratedEngine IStateMachineIndentEngine /// An instance of to which the /// logic for indentation will be delegated. ///
cacheRate int /// The number of chars between caching. ///
return ICSharpCode.NRefactory.Editor

Clone() public method

public Clone ( ) : IStateMachineIndentEngine
return IStateMachineIndentEngine

GetEngine() public method

public GetEngine ( int offset ) : IStateMachineIndentEngine
offset int
return IStateMachineIndentEngine

Push() public method

public Push ( char ch ) : void
ch char
return void

Reset() public method

public Reset ( ) : void
return void

ResetEngineToPosition() public method

Resets the engine to offset. Clears all cached engines after the given offset.
public ResetEngineToPosition ( int offset ) : void
offset int
return void

Update() public method

If the position is negative, the engine will update to: document.TextLength + (offset % document.TextLength+1) Otherwise it will update to: offset % document.TextLength+1
public Update ( int position ) : void
position int
return void