2013-02-27 80 views
1

有什麼辦法可以防止Resharper插入的文件頭被雙重註釋。Resharper文件頭是雙重註釋

我正在使用默認文件頭模板,並打開代碼清理中的插入文件頭。

(ReSharper的版本7.1.2)

// #region Copyright © 2013 xxx Systems, Incorporated 
// // 
// // All rights are reserved. Reproduction or transmission in whole or in part, in 
// // any form or by any means, electronic, mechanical or otherwise, is prohibited 
// // without the prior written consent of the copyright owner. 
// // 
// // Filename: xxx.cs 
// // Date:  27/02/2013 
// // Author: xxx 
// // 
// #endregion 

這裏是模板:

#region Copyright © $CURRENT_YEAR$ xxx Systems, Incorporated 
// 
// All rights are reserved. Reproduction or transmission in whole or in part, in 
// any form or by any means, electronic, mechanical or otherwise, is prohibited 
// without the prior written consent of the copyright owner. 
// 
// Filename: $FILENAME$ 
// Date:  $CURRENT_DAY$/$CURRENT_MONTH$/$CURRENT_YEAR$ 
// Author: $USER_LOGIN$ 
// 
#endregion 
+0

您希望/需要的任何特定原因? – MyCodeSucks 2013-02-27 16:16:46

+0

你的標題模板中有評論標誌(//)嗎?如果是這樣,也許你只需要刪除它們? – 2013-02-27 16:54:09

+0

我將模板添加到問題中。 – 2013-02-27 16:57:40

回答

6

你應該建立一個沒有//模板,它應該只包含

All rights are reserved. Reproduction or transmission in whole or in part, 
any form or by any means, electronic, mechanical or otherwise, is prohibited 
without the prior written consent of the copyright owner. 

Filename: $FILENAME$ 
Date:  $CURRENT_DAY$/$CURRENT_MONTH$/$CURRENT_YEAR$ 
Author: $USER_LOGIN$ 

而且然後在字段「將文件標題帶入名稱區域」(位於文件模板下面),您應該寫入

Copyright © $CURRENT_YEAR$ xxx Systems, Incorporated