如何讓Resharper在每個文件的頂部添加開源許可證?如何讓Visual Studio在每個文件的頂部添加開源許可證
2
A
回答
4
如果我理解正確,您想在每個源文件的頂部留言,詳細說明您的許可模式?
如果是這樣,請嘗試Visual Studio templates。
2
雖然可以製作一個帶有Visual Assist X的小腳本。它不會自動執行,但您只需在頁面頂部輸入lic
即可輸出許可信息。
1
這是我放在一起的MIT許可證的片段。您打開一個C#代碼文件,您鍵入'許可證'選項卡兩次,並且默認爲年份和版權持有人部分。
以下是describes the process的鏈接。希望這可以幫助。
<?xml version="1.0" encoding="utf-8" ?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>Simple MIT License</Title> <Shortcut>license</Shortcut> <Description> The standard MIT licnese. </Description> <Author>Example License</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>year</ID> <ToolTip>Copyright year</ToolTip> <Default>year</Default> </Literal> <Literal> <ID>copyrightholders</ID> <ToolTip>Replace This With the Copyright Holders name</ToolTip> <Default>copyrightholders</Default> </Literal> </Declarations> <Code Language="CSharp"> <![CDATA[ /* The MIT License Copyright (c) $year$ $copyrightholders$ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>
相關問題
- 1. Grails將文本/許可證信息插入到每個源文件的頂部
- 2. 如何讓Visual Studio讓我在調試時添加文件?
- 3. 如何在visual studio 2012中編譯newley添加的源文件?
- 4. 如何在visual studio中添加資源文件
- 5. Microsoft Visual Studio許可證
- 6. Visual Studio C++添加可部署內容(整個文件夾)
- 7. Visual Studio插件自動在每個文件的頂部插入註釋?
- 8. 我可以讓Vim忽略文件頂部的許可證塊嗎?
- 9. 如何在Visual Studio中將源文件添加爲外部依賴項?
- 10. 使用git鉤子來添加許可證和應用程序版本來評論在源文件的頂部
- 11. 在visual studio中,如何在JavaScript文件的每個函數中添加斷點?
- 12. 如何讓Visual Studio識別多個項目資源文件
- 13. 添加一個二進制文件在Visual Studio資源
- 14. 如何使用開源許可證
- 15. Visual Studio,C#如何將doc文件添加爲資源
- 16. Visual Studio 2010:如何添加簡單文件而不是資源?
- 17. 如何將sql文件添加到資源visual studio
- 18. 如何在每個活動頂部添加一種疊加層
- 19. 是在頭文件的頂部添加Doctype足夠還是需要在每個HTML文件的頂部?
- 20. 開源許可證,哪一個?
- 21. JIRA開源許可證
- 22. Opentok開源許可證?
- 23. 從Webpack中的外部文件添加許可證標題
- 24. 如何在樹枝文件中添加許可證註釋?
- 25. 在Visual Studio中顯示控件頂部
- 26. 我應該在源文件的頂部添加標題註釋?
- 27. 如何讓ABPeoplePicker每次打開時從頂部開始?
- 28. Visual Studio 2012 - 無法打開源文件
- 29. 將文本插入每個源文件頂部的方法
- 30. 開源:每個源文件上的許可證標題或單個COPYING還是兩者?
假設許可證是樣板文本(或只有簡單的佔位符),您也可以使用Visual Studio片段執行此操作。 – itowlson 2009-11-04 06:33:54