2017年8月11日 星期五

[C#] GhostDoc Tool

  • GhostDoc
    • 先前有介紹如何由程式碼中的註解產生文件:[C#] XML document using Sandcastle
    • 因此需手動加入許多註解,在介紹此軟體 "GhostDoc"
    • GhostDoc:可以自動產生符合程式中語言的註解
    • 目前安裝 GhostDoc Free,付費版本有多許多功能
    • Demo before
    
        class UserInfo
        {
            public string sUserName { get; set; }
    
            public int nUserAge { get; set; }
    
            public UserInfo(string username, int userage)
            {
                sUserName = username;
                nUserAge = userage;
            }
    
            public string GetUserInfo()
            {
                return string.Format("{0}:{1}", sUserName, nUserAge);
            }
        }
    
    • Demo After
    
        class UserInfo
        {
            /// < summary>
            /// Gets or sets the name of the s user.
            /// < /summary>
            /// < value>
            /// The name of the s user.
            /// < /value>
            public string sUserName { get; set; }
            /// < summary>
            /// Gets or sets the n user age.
            /// < /summary>
            /// < value>
            /// The n user age.
            /// < /value>
            public int nUserAge { get; set; }
    
            /// < summary>
            /// Initializes a new instance of the  class.
            /// </ summary>
            /// < param name="username">The username.< /param>
            /// < param name="userage">The userage.< /param>
            public UserInfo(string username, int userage)
            {
                sUserName = username;
                nUserAge = userage;
            }
    
            /// < summary>
            /// Gets the user information.
            /// < /summary>
            /// < returns>< /returns>
            public string GetUserInfo()
            {
                return string.Format("{0}:{1}", sUserName, nUserAge);
            }
        }
    • 如 Function 有變動,可使用 Ctrl + Shift + D,就可自動更新註解
  • Ref:

沒有留言:

張貼留言