简体   繁体   English

新行未显示在Enterprise Architect的元素注释中

[英]New line not displayed in element notes of Enterprise Architect

I am working on Enterprise Architect C# add-ins to import contents from Excel file to requirement element and exporting the same to Excel. 我正在使用Enterprise Architect C#加载项,以将内容从Excel文件导入到require元素,并将其导出到Excel。

When Excel contents contains new lines are written to element's notes, no new line is seen and the entire contents are displayed as a straight line. 当Excel内容包含新行时,将其写到元素的注释中,则看不到新行,并且整个内容显示为一条直线。

Yet when the notes of the same element are exported to Excel file, the new lines are correctly displayed. 但是,当同一元素的注释导出到Excel文件时,新行将正确显示。 Are there any EA settings for maintaining the new lines in element notes. 是否有任何EA设置用于维护元素注释中的新行。

Sample excel description: 示例Excel说明:

Test: this is a new sentence 
Note: This is a new note 
Aligning element notes is being tested. 

Did you try Environment.Newline or \\r\\n ? 您是否尝试过Environment.Newline\\ r \\ n You need to replace the new line contents with either one of this 您需要用以下任意一项替换新行内容

 EA.Element ele = repository.GetTreeSelectedObject();
 ele.Notes = "111" + Environment.NewLine + "222\r\n333"";
 ele.Update();

Environment.Newline will add a new line and the OP will be like Environment.Newline将添加新行,OP将类似于

111 111

222 222

333 333

For more details refer here 有关更多详细信息,请参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM