C# Class ICSharpCode.NRefactory.CSharp.Refactoring.Script

Class for creating change scripts. 'Original document' = document without the change script applied. 'Current document' = document with the change script (as far as it is already created) applies.
Inheritance: IDisposable
Exibir arquivo Open project: 0xd4d/NRefactory Class Usage Examples

Public Methods

Method Description
AddAttribute ( EntityDeclaration entity, AttributeSection attr ) : void

Adds an attribute section to a given entity.

AddTo ( BlockStatement bodyStatement, AstNode newNode ) : void
AddTo ( TypeDeclaration typeDecl, EntityDeclaration entityDecl ) : void
ChangeBaseTypes ( TypeDeclaration type, IEnumerable baseTypes ) : void

Changes the base types of a type declaration.

ChangeModifier ( EntityDeclaration entity, Modifiers modifiers ) : void

Changes the modifier of a given entity declaration.

ChangeModifier ( ParameterDeclaration param, ParameterModifier modifier ) : void
CreateNewType ( AstNode newType, NewTypeContext context = NewTypeContext.CurrentNamespace ) : void

Creates a new file containing the type, namespace and correct usings. (Note: Should take care of IDE specific things, file headers, add to project, correct name).

Dispose ( ) : void
DoGlobalOperationOn ( IEnumerable entities, Action callback, string operationDescription = null ) : void
FormatText ( ) : void
FormatText ( IEnumerable nodes ) : void
GetCurrentOffset ( TextLocation originalDocumentLocation ) : int

Given an offset in the original document (at the start of script execution), returns the offset in the current document.

GetCurrentOffset ( int originalDocumentOffset ) : int

Given an offset in the original document (at the start of script execution), returns the offset in the current document.

GetSegment ( AstNode node ) : ISegment

Gets the current text segment of the specified AstNode.

InsertAfter ( AstNode node, AstNode newNode ) : void
InsertBefore ( AstNode node, AstNode newNode ) : void
InsertText ( int offset, string newText ) : void
InsertWithCursor ( string operation, ICSharpCode.NRefactory.TypeSystem.ITypeDefinition parentType, Func nodeCallback ) : Task