Google

星期三, 九月 24, 2008

Multiple Thread Progress Bar Control

Introduction

This article presents a control that creates threads and displays the progress and any messages sent from the thread.

Background

Running multiple threads and seeing the status of where they are has been a tricky subject for quite a while. The main thing being that you could not access anything that is being controlled by the main (UI) thread. This includes all parts of the form you are displaying and the properties and variables on it.

The .Net framework 2.0 has helped clear up some of that with the introduction of the BackgroundWorker class. This class allows you to run some code on its own thread. This allows your UI to remain responsive while the code runs.

What It Does

This control can be easily modified to be used to monitor/control batch operations that can be done simultaneously. Some examples:

  • File Transfers
  • Image Processing
  • Directory Processing
  • Screen scraping

Each thread can send its own messages back to the container. The container shows those messages in a grid as the threads are running.

The thread container actually does throttling as well. Before you start the threads, you can set the number of threads you want to run concurrently. I hope to eventually make this property dynamic so that it can be changed on the fly.

What It Does Not Do

This control is designed for items that do not update the UI other than what is already displayed. If you need to render objects and update the screen, you will need to modify the way this works. That may be another article.

How it Works

Each thread is represented in a ThreadView which inherits from UserControl. This ThreadView contains a BackgroundWorker. When the ThreadContainer.Start method is called it creates as many threads as it can (either Concurrent or TotalThreads if it is less than Concurrent). The ThreadViews are docked to the top so that they are all displayed nicely and expand to the width of the ThreadContainer. After creating the new ThreadView and displays it and starts it. As it works it raises its JobEvent event. This passes the message to the container and the ThreadContainer stores it in its DataTable.

Each ThreadView contains a JobCompleted event that notifies the ThreadContainer that it is done.

http://www.codeproject.com/KB/progress/MultiThreadProgressBar.aspx

标签: , , ,

星期二, 八月 19, 2008

ShootSearch 中文分词组件(c#开源)

ShootSearch 中文分词组件(c#开源) 技术支持:support@shootsoft.net http://www.shootsoft.net 分词算法:词库+最大匹配 词库来自www.jesoft.cn,已经过一定的修改 使用说明: 先加载词库,再进行分词.分词过程重载两次:支持回车的和不支持回车的,注意选择! 可以手动添加词语到sDict.txt,不过每次手动修改后需要调用SortDic()方法,否则无法实现最大匹配! sDict.txt的编码为UTF-8!

http://download.csdn.net/source/159089

标签: , ,

星期二, 三月 18, 2008

MonoDevelop 1.0正式发布!

MonoDevelop团队骄傲地宣布了MonoDevelop 1.0的正式发布。MonoDevelop是一款GNOME下的集成开发工具,可以利用日趋流行的.Net语言来开发GTK#应用程序和ASP.NET应用等。—–MonoDevelop支持使用C#和其他.NET语言进行开发,它使得开发者可以在Linux和Mac OSX上非常迅速的开发出桌面软件和ASP.NET Web应用。除此之外,MonoDevelop还允许开发者非常简单的将VisualStudio开发的.NET应用程序移植到Linux和Mac OS X下,这样开发者只需要维护一套代码即可──因为GTK#是跨平台的。或许有人对于Microsoft的.NET环境有些抵触,而开放的桌面环境:GNOME早已将开源实现的.NET运行环境Mono纳入了默认支持当中。GNOME系统的“Tomboy便笺”即是用C#编写,Novell出品的照片管理工具:F-spot也是如此,同样还有著名的索引搜索工具Beagle。通过Mono,能吸引更多的开发者,这何尝不是一件好事?再谈最新的MonoDevelop 1.0,它是一款非常强大的集成开发环境,有如下特性:
代码补全。
参数信息。
信息提示。
即时错误检查。
代码导航。
智能索引。
自动生成XML标签。
代码模板。
类和成员选择器。
单元测试。
打包和部署。
版本控制。
Visual Studio支持。
国际化支持。最棒的是,如果你使用C#的话,还能使用集成GTK#的可视化设计。这是目前为止GNOME环境下唯一的集成可视化设计器的IDE,Anjuta也不支持。
http://linux.chinaunix.net/bbs/viewthread.php?tid=983464

标签: , ,

辽ICP备05003652号
流风洄雪听天籁,轻云蔽日看落花

Powered by Blogger