tailieunhanh - C# 2005 Programmer’s Reference - chapter 16

Tham khảo tài liệu 'c# 2005 programmer’s reference - chapter 16', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 316 CHAPTER 16 Windows Forms Table describes the differences between user settings and application settings. TABLE The Scope of the Configuration Settings Setting Description Application All instances and users are affected by these settings. They cannot be changed during runtime. The configurations live in the file located with the executable. User The settings can be changed on a user basis. They can be changed during runtime. The settings file is stored in the user s application data directory. Behind the scenes Visual Studio will generate properties of the correct type for your code to use. Here s an example public partial class Form1 Form public Form1 InitializeComponent load the settings into our UI save settings when we close protected override void OnClosing CancelEventArgs e can t do this--app settings are read-only better save if you want to see the settings next time the app runs For a demo and the full source code see the ConfigValuesDemo project in this chapter s sample code. Use Listview Efficiently in Virtual Mode 317 Use Listview Efficiently in Virtual Mode Scenario Problem Have you ever tried to enter over a few thousand items into a ListView control If so you know that it does not perform well. However it is possible to efficiently list over say 100 000 000 items in a ListView without it choking. Solution The key is to use ListView s virtual mode which uses callbacks to retrieve the data it needs to display. You should use virtual mode intelligently to avoid continually re-creating objects that the garbage collector will need to clean up. For this reason the following sample code sets up a simple caching system where .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.