Posts

Showing posts from November 9, 2008

BackgroundWorker in VS.net 2005

BackgroundWorker in VS.net 2005 There are many types of operations that can take a long time to execute. For example: Downloader, File downloads and uploads (including for peer-to-peer applications) , Complex local Computing and Database transactions, Local disk access, given its slow speed relative to memory access Operations like these can cause your user interface to hang while they are running. When you want a responsive UI and you are faced with long delays associated with such operations, the BackgroundWorker component provides a convenient solution. The BackgroundWorker component gives you the ability to execute time-consuming operations asynchronously ("in the background"), on a thread different from your application's main UI thread. To use a BackgroundWorker, you simply tell it what time-consuming worker method to execute in the background, and then you call the RunWorkerAsync method. Your calling thread continues to run normally while the worker method runs as

Listview in virtual mode C# Winform

Listview in virtual mode .net winform: virtual mode is usefull for larg number of data. two main property for listview in virtual mode 1. virtual mode=true 2. VirtualListSize=10000 //should be morethan 0 main event for virtual mode void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { e.Item = new ListViewItem(x.ToString()); } Setting the VirtualMode property to true puts the ListView into virtual mode. In Virtual mode, the normal Items collection is unused. Instead, ListViewItem objects are created dynamically as the ListView requires them. Virtual mode can be useful under many circumstances. If a ListView object must be populated from a very large collection already in memory, creating a ListViewItem object for each entry can be wasteful. In virtual mode, only the items required are created. In other cases, the values of the ListViewItem objects may need to be recalculated frequently, and doing this for the whole collection would produce unaccep