2009-03-28 3 views
44

<see cref="switch" /> 예를 들어, 작동하지 않습니다 - 내가 컴파일 경고 얻을 : ... 관심이있는 사람들을위한 XML comment on ... has syntactically incorrect cref attribute 'switch'XML 문서에서 C# 키워드를 어떻게 참조합니까?


상황을

/// <summary>Provides base functionality for hand-coded abstractions of API method wrappers, mostly those that abstract over 
/// parameters that are required to be JSON-encoded.</summary> 
public class FacebookArgs : Dictionary<String, Object> 
{ 
    /// <summary>Initializes an instance of <see cref="FacebookArgs" />.</summary> 
    public FacebookArgs() { } 

    /// <summary>Intializes an instance of <see cref="FacebookArgs" />, that contains elements copied from <paramref name="dictionary "/>.</summary> 
    /// <param name="dictionary"></param> 
    public FacebookArgs(IDictionary<String, Object> dictionary) 
     : base(dictionary) { } 

    /// <summary>Gets or sets the value associated with the specified key.</summary> 
    /// <param name="key">The key of the value to get or set.</param> 
    /// <returns>The value associated with the specified key.</returns> 
    /// <remarks>This implementation hides the base indexer implementation such that specifying a key that does not exist returns null rather than throwing a <see cref="KeyNotFoundException" />.</remarks> 
    public new Object this[String key] 
    { 
     get 
     { 
      Object value; 
      if (this.TryGetValue(key, out value)) return value; 
      else return null; 
     } 
     set { base[key] = value; } 
    } 

    /// <summary>In derived classes, provides specialized serialization logic for specific properties contained in this object.</summary> 
    /// <param name="key">The key of the property to serialize.</param> 
    /// <param name="args">A reference to a dictionary of arguments that will be passed directly to a <see cref="FacebookRequest" /> object.</param> 
    /// <remarks> 
    /// <para>This method allows specialized serialization logic, such as JSON encoding, to be applied to specific properties.</para> 
    /// <para>To implement, use a <c>switch</c> (<c>Select</c> in VB.NET) statement to filter based on <paramref name="key" /> and provide the property-specific logic. 
    /// The resulting value should then be added to <paramref name="args" /> using the same <paramref name="key "/>. 
    /// </para> 
    /// <para>Properties that do not require additional processing (strings, integral values, etc) should be ignored.</para> 
    /// </remarks> 
    protected virtual void SerializeProperty(String key, ref IDictionary<String, Object> args) { } 

    /// <summary>Returns a dictionary of key/value pairs suitable to be passed a <see cref="FacebookRequest" /> object.</summary> 
    /// <returns>A dictionary of key/value pairs suitable to be passed a <see cref="FacebookRequest" /> object.</returns> 
    /// <remarks>This method calls the <see cref="SerializeProperty" /> for each key in the object, which allows property-specific processing 
    /// to be done on any property.</remarks> 
    /// <seealso cref="SerializeProperty" /> 
    public IDictionary<String, Object> GetArgs() 
    { 
     IDictionary<String, Object> args = new Dictionary<String, Object>(); 

     foreach (String key in this.Keys) 
     { 
      this.SerializeProperty(key, ref args); 

      if (!args.ContainsKey(key) && this[key] != null) 
      { 
       args.Add(key, this[key]); 
      } 
     } 

     return args; 
    } 
} 

문제의 태그를 추가 할 수 있습니다 SerializeProperty에 대한 <remarks> 태그에서 찾을 수 있습니다. 나는 장황한 문서의 측면에서 실수하고있다. 나 또한 일부 <example> s를 제공 할 계획이지만, 아직 그것에 대해 아직 알지 못했습니다.

답변

64

CREF는 다른 멤버를 참조하기위한 것입니다 -

는 당신이이 경우에 링크 무엇을 기대 등 클래스, 메소드를? 일반적으로 전반적인 효과는 무엇을 원하니? 당신을 도와

<see langword="switch" /> 

겠습니까 :

excellent XML doc guide에 따르면, <see> 태그는 문서화되지 않은 속성 langword이있다? 그것은 단지 그것이 무엇을하는지보기 위해 노력할만한 가치가있을 것입니다.

그냥 일반적인 하이퍼 링크를 사용하려면 대신 CREF의 HREF를 사용

<see href="http://msdn.microsoft.com/en-us/library/06tc147t.aspx">switch</a> 
+0

스위치 키워드의 MSDN 기사 : http://msdn.microsoft.com/en-us/library/ 06tc147t.aspx –

+0

C# 프로젝트 내에서 VB.NET에서도 작동합니다! 구현하려면, ( 참조하십시오) –

+0

이전에 그 속성을 본 적이 없었습니다. 방금 페이지를 알고 그 자체에 대해 무엇을 말했는지 보았습니다. –