Как работать с длинной строкой описания для функции интерфейса - PullRequest
1 голос
/ 04 февраля 2010

Я получил длинное описание для моей функции интерфейса.

IMyInterface.cs

[Description("Line 1 description content here! Line 2 description content here!Line 3  description content here!Line 4 description content here!Line 5 description content here!Line 6 description content here!")]
void foo()
{
}

Как преобразовать одну строку в многострочный стиль. спасибо.

[Description("Line 1 description content here! 
 Line 2 description content here!Line 3 description content here!
 Line 4 description content here!Line 5 description content here!
 Line 6 description content here!")]
void foo()
{
}

1 Ответ

4 голосов
/ 04 февраля 2010

Вы хотите использовать дословную строку, просто добавьте @ к вашей строке:

[Description(@"Line 1 description content here!  
 Line 2 description content here!
 Line 3 description content here! 
 Line 4 description content here!
 Line 5 description content here! 
 Line 6 description content here!")] 
void foo() 
{ 
} 

Обратите внимание, что отступы, начинающиеся со строки 2, в этом случае будут частью вашей строки.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...