Source.GetCommentFormat 方法
获取有关的信息都定义语言的注释。
命名空间: Microsoft.VisualStudio.Package
程序集: Microsoft.VisualStudio.Package.LanguageService.10.0(在 Microsoft.VisualStudio.Package.LanguageService.10.0.dll 中)
Microsoft.VisualStudio.Package.LanguageService(在 Microsoft.VisualStudio.Package.LanguageService.dll 中)
Microsoft.VisualStudio.Package.LanguageService.11.0(在 Microsoft.VisualStudio.Package.LanguageService.11.0.dll 中)
Microsoft.VisualStudio.Package.LanguageService.9.0(在 Microsoft.VisualStudio.Package.LanguageService.9.0.dll 中)
语法
声明
Public Overridable Function GetCommentFormat As CommentInfo
public virtual CommentInfo GetCommentFormat()
返回值
类型:Microsoft.VisualStudio.Package.CommentInfo
包含定义注释的字符串的 CommentInfo 结构。
备注
若要支持添加注释到和移除注释从源代码, Source 类需要知道定义行注释 (从行注释字符运行到行尾) 和块注释 (运行从开始块注释字符。块规注释字符,经常跨多个行)。 此方法提供该信息。 如果该语言不为注释使用 C#/C++ 格式,则必须从 Source 类派生类并重写此方法提供适当的注释分隔符。
基方法创建新的 CommentInfo 并将 C#/C++ 行填充该和块注释分隔符,具体而言, “/”, “/*”,将 “*”。 基方法还意味着可以使用行注释。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。