C# Class Rosetta.Translation.NestedElementTranslationUnit

Class describing nested elements.
显示文件 Open project: andry-tino/Rosetta Class Usage Examples

Public Methods

Method Description
IncrementNestingLevel ( ITranslationUnit translationUnit, ITranslationUnit parentTranslationUnit ) : void

Utility method used to safely increment the nesting level of an ITranslationUnit only in case it supports nesting level.

This will cause translationUnit to be checked. In case it supports nestin level, then its nesting level is changed in order to have the nesting level of parentTranslationUnit + 1.

Protected Methods

Method Description
AddTranslationUnit ( ITranslationUnit translationUnit ) : void

Ensures that compound ITranslationUnit will increment added unit's nesting level. TODO: Use this!

AddTranslationUnitCore ( ITranslationUnit translationUnit ) : void

Logic to provide in subclasses to add ITranslationUnit (for compound translation units). TODO: Turn this into abstract and make all unit use one method for add compound units. TODO: Add to ICompoundUnit interface and have classes distinguish uisng RTTI!

NestedElementTranslationUnit ( ) : System

Initializes a new instance of the NestedElementTranslationUnit.

NestedElementTranslationUnit ( NestedElementTranslationUnit other ) : System

Copy initializes a new instance of the NestedElementTranslationUnit.

For testability.

NestedElementTranslationUnit ( int nestingLevel ) : System

Initializes a new instance of the NestedElementTranslationUnit.

OnNestingLevelChanged ( ) : void

When the indentation level changes, we need to apply a different formatter. When the nesting level changes, this procedure will adjust it in case the automatic nesting level has been set to automatic.

Method Details

AddTranslationUnit() protected method

Ensures that compound ITranslationUnit will increment added unit's nesting level. TODO: Use this!
protected AddTranslationUnit ( ITranslationUnit translationUnit ) : void
translationUnit ITranslationUnit The translation unit to add.
return void

AddTranslationUnitCore() protected method

Logic to provide in subclasses to add ITranslationUnit (for compound translation units). TODO: Turn this into abstract and make all unit use one method for add compound units. TODO: Add to ICompoundUnit interface and have classes distinguish uisng RTTI!
protected AddTranslationUnitCore ( ITranslationUnit translationUnit ) : void
translationUnit ITranslationUnit The translation unit to add.
return void

IncrementNestingLevel() public static method

Utility method used to safely increment the nesting level of an ITranslationUnit only in case it supports nesting level.
This will cause translationUnit to be checked. In case it supports nestin level, then its nesting level is changed in order to have the nesting level of parentTranslationUnit + 1.
public static IncrementNestingLevel ( ITranslationUnit translationUnit, ITranslationUnit parentTranslationUnit ) : void
translationUnit ITranslationUnit The whose nesting level should be incremented.
parentTranslationUnit ITranslationUnit The which is supposed to be the parent.
return void

NestedElementTranslationUnit() protected method

Initializes a new instance of the NestedElementTranslationUnit.
protected NestedElementTranslationUnit ( ) : System
return System

NestedElementTranslationUnit() protected method

Copy initializes a new instance of the NestedElementTranslationUnit.
For testability.
protected NestedElementTranslationUnit ( NestedElementTranslationUnit other ) : System
other NestedElementTranslationUnit
return System

NestedElementTranslationUnit() protected method

Initializes a new instance of the NestedElementTranslationUnit.
protected NestedElementTranslationUnit ( int nestingLevel ) : System
nestingLevel int
return System

OnNestingLevelChanged() protected method

When the indentation level changes, we need to apply a different formatter. When the nesting level changes, this procedure will adjust it in case the automatic nesting level has been set to automatic.
protected OnNestingLevelChanged ( ) : void
return void