標籤:
1. WPF是什麼: Windows Presentation Foundation, 它提供了統一的編程模型、語言和架構,真正做到了分離介面設計人員與開發人員的工作, WPF由XAML( eXtensible Application Markup Language )語言編寫。
2. Windows Form Project是由幾個檔案構成的:它們有不同的功能劃分
3. 對於一個應用,最重要的就是對使用者的各種events做出反應,那麼監聽器的實現就非常重要,而VS將監聽器的設計介面化,我們只需要雙擊控制項,VS就會自動產生預設的eventhandler的方法名,完成委託。
Attribute:
1. C# 提供一種對稱為屬性的聲明標記進行定義的機制。可以將屬性置於原始碼的某些實體上以指定附加資訊。可以在運行時通過反射檢索屬性包含的資訊。您可以使用預定義屬性或者定義自己的自訂屬性。
2. Attributes and reflection have an intimate relationship with assembly metadata. Attributes are a part of that metadata, and reflection understands metadata, allowing you to extract information about attributes and code.
3. attribute也有很多用途,分為很多類,但是它們都是開發人員設定的警告或者需要注意的地方,如在使用標記了Obsolete特性的方法時會發出警告資訊,而assembly可以設定一些環境變數之類的,attribute還能指定序列化
4. 我們也可以自己定義attribute,attribute對輸出沒有影響
5. Reflection provides the capability to discover information about a program at runtime.
1.Viewing metadata(可用於bug的資訊檢索) 2.Performing type discovery 3.Late binding to methods and properties 4.Creating types at runtime (reflection emit)
C#之Windows Form Application與attribute