3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/IndentState.cs
/// <summary>
///     Checks if the given string is a keyword and sets the
///     <see cref="NextBody"/> and the <see cref="CurrentStatement"/>
///     variables appropriately.
/// </summary>
/// <param name="keyword">
///     A possible keyword.
/// </param>
/// <remarks>
///     This method is called from <see cref="Push(char)"/>
/// </remarks>
Checks if the given string is a keyword and sets the
and the
variables appropriately.
Checks if the given string is a keyword and sets the and the variables appropriately .
public override void CheckKeywordOnPush(string keyword)
		{
			if (keyword == "else")
			{
				CurrentStatement = Statement.Else;
				if (!Engine.formattingOptions.AlignElseInIfStatements && NestedIfStatementLevels.Count > 0)
				{
					ThisLineIndent = NestedIfStatementLevels.Pop().Clone();
					NextLineIndent = ThisLineIndent.Clone();
				}
				NextLineIndent.Push(IndentType.Continuation);
			}
			if (blocks.Contains(keyword) && Engine.NeedsReindent)
			{
				LastBlockIndent = Indent.ConvertFrom(Engine.CurrentIndent, ThisLineIndent, Engine.textEditorOptions);
			}
		}
public override void CheckKeywordOnPush ( string keyword ) { if ( keyword == " " ) { CurrentStatement = Statement . Else ; if ( ! Engine . formattingOptions . AlignElseInIfStatements && NestedIfStatementLevels . Count > 0 ) { ThisLineIndent = NestedIfStatementLevels . Pop ( ) . Clone ( ) ; NextLineIndent = ThisLineIndent . Clone ( ) ; } NextLineIndent . Push ( IndentType . Continuation ) ; } if ( blocks . Contains ( keyword ) && Engine . NeedsReindent ) { LastBlockIndent = Indent . ConvertFrom ( Engine . CurrentIndent , ThisLineIndent , Engine . textEditorOptions ) ; } }
Checks if the given string is a keyword and sets the
and the
variables appropriately.
Checks if the given string is a keyword and sets the and the variables appropriately .
// OPTION: CSharpFormattingOptions.AlignElseInIfStatements
keyword
string
A possible keyword.
A possible keyword .
remarks
This method is called from
This method is called from