我總覺得,我很想念,可以在.net中通過簡單地將屬性應用於類,方法,屬性等,並沒有什麼幫助來獲得功能該intellisense無法顯示所有適當的屬性,因爲它們通常可以在各種場景中應用。
這裏有一對夫婦,我喜歡使用的屬性:
[DebuggerHidden] - 將這種過度的方法可以防止在Visual Studio調試器步進的代碼。如果您遇到不斷觸發並中斷調試的事件,這非常有用。
[EditorBrowsable(EditorBrowsableState.Never)] - 從intellisense中隱藏方法。我不經常使用它,但在構建可重用組件時您很方便,並且您想隱藏一些測試或調試方法。
我想看看別人正在使用和人們有什麼提示。
+1大問題,希望看到一些迴應。 – 2010-01-16 11:10:23
我實際上會投票結束,因爲這不是一個真正的問題。答案是,「所有這些」。屬性不會被創建爲不可用。 – 2010-01-16 11:15:07
dup? http://stackoverflow.com/questions/144833/most-useful-attributes-in-c – 2010-01-16 11:15:07