摘要:
前台线程和后台线程的区别和联系:1、后台线程不会阻止进程的终止。属于某个进程的所有前台线程都终止后,该进程就会被终止。所有剩余的后台线程都会停止且不会完成。2、可以在任何时候将前台线程修改为后台线程,方式是设置Thread.IsBackground 属性。3、不管是前台线程还是后台线程,如果线程内出现了异常,都会导致进程的终止。4、托管线程池中的线程都是后台线程,使用new Thread方式创建的线程默认都是前台线程。下面做个小例子来证实一下,代码如下很简单: 1 class Program 2 { 3 static AutoResetEvent autoEvent =new Auto... 阅读全文
随笔档案-2011年08月
Silverlitht数据输入验证工具类
2011-08-26 17:55 by 雨林, 438 阅读, 收藏, 编辑
摘要:
提供一个工具类,用于进行Silverlitht数据输入验证。原理:在页面提交时,对页面的输入项进行验证。用法很简单,把工具类文件添加到你的项目中,使用时不需要在xaml页面进行绑定,直接在后台cs页面就简单的几行代码就可以。目前只能进行非空验证,和数值验证,不过添加其他验证也是很容易的。调用示例如下:前台xaml代码 <StackPanel Margin="5"> <StackPanel Orientation="Horizontal" Margin="5"> <TextBlock Text=" 阅读全文
Entities exposed by DomainService operations must have at least one public property marked with the KeyAttribute
2011-08-11 18:07 by 雨林, 569 阅读, 收藏, 编辑
摘要:
使用ado.net entity framework从存储过程生成复杂类型实体类,然后使用WCF ria service将实体类想客户端暴露。编译过程中产生一个错误,The entity '实体类' in DomainService 'wcf ria 服务' does not have a key defined. Entities exposed by DomainService operations must have at least one public property marked with the KeyAttribute产生这个错误是因为 ado 阅读全文