If you are a developer, than I guess Property Grid isn’t a stranger to you. Property grid has been used in win form designer to manipulate the properties of the selected object in the designer. Property Grid can also be used as control to use on your own form , to give user a compact way to manipulate properties( It is not available in the tool box , you will need to add it by using choose item option in Visual Studio). Property Grid has an interesting feature , it can show Type specific editor if one is available . e.g editing a color value will result in opening a color box, similarly for font and other types. If you want to have an editor for your custom data type , then you can implement a UITypeEditor and bind it to the target type using attirbute.
Some times you don’t use the whole Property Grid , but only want to display a certain type editor on your form, e.g you want to give user , option to edit a font , and want to utilize the font editor . How this can be achieved? Well, its simple , all you need to do is implement the IWindowFormsEditorService interface and provide a form or control to host the uitype editor.
I came across a very insightful article on DevX about implementing these requirements. Emmanuel Tissandier has not only explained the underlying architecture of UITypeEditor but also impelement a control which can be used to host any UITypeEditor, and so you can have a generice type editor.
Article can be accessed here: Build A Property Editor That Can Edit Any .Net Type
I am back after a loooonnnng vacation. . I have been really busy during that period (if activity of wasting time is cosidered as a task
Just to start with something, here are some of articles that I have read during my so called vacations.
Have you ever noticed , how Windows XP Explorer sorts files in a directory by file name. It does an intelligent sorting by considering the file names and also take into account if there is digit in the file name. e.g file1.txt , file2.txt and file10.txt . Ordinary string sorting places these 2 strings as file1.txt ,file10.txt, file2.txt, which isn’t the right order. XP sees these strings differently and sort them in almost correct orderi.i.e file1.txt, file2.txt and file10.txt.
This type of sorting might be required in other applications as well. Pascal Ganaye has written an execellent article on Natural Number Comprarer .
Nice article on Manipulating Colors in .Net by Guillaume Leparmentier in which he discussed the different color models and their inter-conversion. Very informtive!!!
Often you need good compression and archiving APIs, so why not use the Microsoft’s own cab file implementation. Thats exactly what Elmue has done and explained in his article Cabinet File : Compression and Extraction.
gotdotnet, is now being phased out. Although Microsoft has extended the timeline, so the users can coupe up with the changes but eventually it has to end someday. There are several others community platform which Microsoft has recently launched. Two of them I would like to mention, Codeplex (sort of sourceforge like initiative). and WindowsClient.net (for supporting windows application on .net). I don’t like Codeplex thing, but its better to have something instead of nothing. Windows Client is a better site with forums, and articles to help .net developers on windows desktop applications. It targets winform as well as windows presentation foundation (WPF). These two sites may provide a better replacement for gotdotnet. Lets see.
ThreadPool in .net framework , as the name applies , a pool of thread, that an application can use to execute diiferent code section concurrently, instead of creating its own thread. Application borrows thread from thread pool to exectue via ThreadPoolQueueUserWorkItem , which queues the request , the request is furnished when a thread is available in the thread pool. After execution , the thread is returned to the pool so other requests in the queue can use it. Thread pool are mostly utilized in Asynchronous Programming model.
In the release of .net framework 2.0 , the default max no. of available threads in the pool was 25 per processor. You can set it to a different value, but it is usually discouraged to set to a value too higher, and you may need to reconsider your application (profiling etc) , since it may lead to starvation of the threads. With .net 2.0 SP1 , this max no of thread has been elevated to 250 threads per cpu . Joe Duffy has discussed about necessity of this higher limit in his post.
well I think it is not a good decision, setting a default 250 limit, will result in larger startup time to intialize the thread pool. Though you can set your limit to a lower level,(do it as early as you can). But I think this feauter should be an opt-in feature , instead of an opt-out (as .net framework 2.0 already presents it).