属性和XML文档的方法/属性 [英] Attributes and XML Documentation for method/property

查看:128
本文介绍了属性和XML文档的方法/属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想有一个方法/属性的属性和XML文档 - 什么是正确的顺序编写它们的方法/属性上面

When I want to have an attribute and XML documentation for a method/property - what is the correct order to write them above the method/property?

这声音?那么微不足道,可是......

This sounds so trivial, but...

如果我使用:

/// <summary>
/// Something here
/// </summary>
[MyAttribute]
public void MyMethod() {}



构建成功和ReSharper的是快乐,但我看不出在IntelliSense为 MyClass.MyMethod 的文档。

当我使用:

[MyAttribute]
/// <summary>
/// Something here
/// </summary>
public void MyMethod() {}



构建是成功的,但ReSharper的有一个警告( XML注释没有放在有效语言元素的),我还没有看到在智能感知 MyClass.MyMethod 的文档。

Build is successful but ReSharper has a warning (XML comment is not placed on a valid language element), and I still don't see the documentation in IntelliSense for MyClass.MyMethod.

我在网上搜索,看到只有在没有证件的使用属性的示例;或者没有属性的文件。

I've searched the internet and see only examples where attributes are used without documentation; or documentation without attributes.

难道真的没有办法有同样的方法/属性的属性和XML文档?

Is there really no way to have attributes and XML documentation for the same method/property?

信息:WPF应用程序,.NET 4.0,C#

Info: WPF application, .NET 4.0, C#.

推荐答案

使用第一种情况下,

/// <summary>
/// Something here
/// </summary>
[MyAttribute]
public void MyMethod() {}



ReSharper的喜欢它它应该给你这里的的东西的在IntelliSense。当它不那么有解决的另一个问题。

Resharper likes it and it should give you Something here in Intellisense. When it doesn't then there is another problem to solve.

这篇关于属性和XML文档的方法/属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆