Insert a blank line

Hi all

Simple question (I hope):

How do I insert a blank line into a function body?

Something like:

CSharpElementFactory factory = CSharpElementFactory.GetInstance(Solution);
IBlankLine line = factory.CreateBlankLine();
functionDeclaration.Body.AddStatementBefore(line, anchor);

Thanks

--Jakob


0
3 comments

C

  1. or VB?


--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Jakob Christensen" <jc@sitecore.net> wrote in message
news:b5a5f1a13cd8c9808676fbb269@news.jetbrains.com...

Hi all

>

Simple question (I hope):

>

How do I insert a blank line into a function body?

>

Something like:

>

CSharpElementFactory factory = CSharpElementFactory.GetInstance(Solution);
IBlankLine line = factory.CreateBlankLine();
functionDeclaration.Body.AddStatementBefore(line, anchor);

>

Thanks

>

--Jakob

>



0

Hello Eugene,

Wow - that was a fast reply!

C#

Thanks.

--Jakob

C

  1. or VB?



0

using (WriteLockCookie.Create())
{
StringBuffer newLineText = new StringBuffer("\r\n");

LowLevelModificationUtil.AddChildAfter(statement,
TreeElementFactory.CreateLeafElement (CSharpTokenType.NEW_LINE, newLineText,
0, newLineText.Length));

}

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Jakob Christensen" <jc@sitecore.net> wrote in message
news:b5a5f1a13d28c980897fecb118@news.jetbrains.com...

Hello Eugene,

>

Wow - that was a fast reply!

>

C#

>

Thanks.

>

--Jakob

>
>> C# or VB?
>>
>



0

Please sign in to leave a comment.