mrfangzheng

Hope and fear are useless. Be confident, and always be prepared for the worst.
  首页  :: 新随笔  :: 联系 :: 管理

随笔分类 -  [计算机]Tech

摘要:Mock: 记录了接口被调用的顺序, 次数, 参数和返回值. 这些都必须在随后的测试上得到验证. 如果在Record时记录了一次接口的方法调用, 而测试对象实际上并没调用该接口的方法的话, 验证会失败. Stub: 记录了接口被调用的信息, 但不验证. 测试对象可能调用了这个接口, 也可能没有调用. 阅读全文

posted @ 2009-09-24 22:48 mrfangzheng 阅读(595) 评论(0) 推荐(0)

摘要:BitmapSource BitmapFrameBitmapSource image5 = BitmapSource.Create( width, height, 96, 96, PixelFormats.Indexed1, BitmapPalettes.WebPalette, pixels, stride); FileStream stream5 = new FileStream("palett... 阅读全文

posted @ 2009-09-24 11:43 mrfangzheng 阅读(198) 评论(0) 推荐(0)

摘要:2D Graphics and Imaging 尽量使用Drawing来代替Shape. 因为Drawing不用支持Layout和Event 尽量使用DrawingVisual来绘制背景等不需要Layout和Event的地方 使用图形时, 尽量decode到最小的size 在动画时, 调用RenderOptions.SetBitmapScalingMode()把图片设置到LowQuality 缓... 阅读全文

posted @ 2009-09-23 12:51 mrfangzheng 阅读(447) 评论(0) 推荐(0)

摘要:WPF Tutorial - How To Use A DataTemplateSelector DataTemplateSelector可以让程序在runtime选择合适的DataTemplate 一般先从DataTempalteSelector类继承一个子类, 重写SelectTemplate方法 public class ImgStringTemplateSelector : DataTem... 阅读全文

posted @ 2009-09-21 22:21 mrfangzheng 阅读(989) 评论(0) 推荐(0)

摘要:ControlTemplate用于描述控件本身. 使用TemplateBinding来绑定控件自身的属性, 比如{TemplateBinding Background}DataTemplate用于描述控件的Content. 使用Binding来绑定数据对象的属性, 比如{Binding PersonName}一般来说, ControlTemplate内有一个ContentPresenter, 这个... 阅读全文

posted @ 2009-09-21 22:13 mrfangzheng 阅读(2322) 评论(0) 推荐(1)

摘要:几个问题: log内容的尺寸可能很大 log能够发送给开发者 log文件能够方便的被找到 用户能够调整logging级别 阅读全文

posted @ 2009-06-19 15:51 mrfangzheng 阅读(171) 评论(0) 推荐(0)

摘要:SetIP.bat runas /user:administrator "netsh int ip set address """本地连接""" static 10.10.20.44 255.255.255.0 10.10.20.1 1 " runas /user:administrator "netsh int ip set dns """本地连接""" static 10.10.10.2 pr... 阅读全文

posted @ 2009-05-12 17:02 mrfangzheng 阅读(793) 评论(0) 推荐(0)

摘要:[代码] 阅读全文

posted @ 2009-04-07 17:00 mrfangzheng 阅读(267) 评论(0) 推荐(0)

摘要:异常 The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'. 解决方案 1 配置IIS 网站->属性->目录安全性->身份验证方法... 阅读全文

posted @ 2009-02-25 09:05 mrfangzheng 阅读(509) 评论(0) 推荐(1)

摘要:Windows Presentation Foundation Graphics Rendering Overview Visual : Output display, transformations, clipping, hit testing, bounding box UIElement : 继承自Visual, 包括input, focus, eventing, layout servic... 阅读全文

posted @ 2009-01-15 11:34 mrfangzheng 阅读(276) 评论(0) 推荐(1)

摘要:Data Binding Overview Binding Sources Overview Data Templating Overview Binding Declarations Overview Data Binding How-to Topics 阅读全文

posted @ 2009-01-13 21:33 mrfangzheng 阅读(197) 评论(0) 推荐(0)

摘要:概述 http://msdn.microsoft.com/en-us/library/ms750613.aspx 需要重用的对象都可以定义成资源, 比如Style, Template, Brush等. 每个FrameworkElement或者FrameworkContentElement元素都有Resources(ResourceDictionary类型)属性. 一个资源一般有一个key, 比如:... 阅读全文

posted @ 2009-01-12 21:06 mrfangzheng 阅读(265) 评论(0) 推荐(0)

摘要:概念 Resource Data Binding Style Template DataTemplate 阅读全文

posted @ 2009-01-12 20:57 mrfangzheng 阅读(202) 评论(0) 推荐(0)

摘要:Action无返回值 Func有返回值 使用: Action act = delegate { //Do somthing } ; this.Dispatcher.BeginInvoke(DispatcherPriority.Noraml, act); 阅读全文

posted @ 2008-11-24 20:05 mrfangzheng 阅读(398) 评论(0) 推荐(0)

摘要:继承 使用 Win 阅读全文

posted @ 2008-11-18 10:01 mrfangzheng 阅读(210) 评论(0) 推荐(0)

摘要:由于SQL Server的OSql工具只认ANSI和Unicode, 不认UTF8, 所以尽量把Visual Studio的.sql文件用Unicode保存. 方法是修改SQL模版的encoding, 另存为Unicode格式, 文件模版的位置: \Microsoft Visual Studio 9.0\Common7\Tools\Templates\Database Project Items ... 阅读全文

posted @ 2008-11-14 11:29 mrfangzheng 阅读(569) 评论(0) 推荐(0)

摘要:Control | +---- ContentControl 对应ControlTemplate | | | +---- ListBoxItem | | | +---- HeaderedContentControl | | | +---- TabItem | +---- It... 阅读全文

posted @ 2008-11-05 10:13 mrfangzheng 阅读(803) 评论(0) 推荐(0)

摘要:得到表的所有列名SELECT syscolumns.name FROM syscolumns,sysobjects WHERE syscolumns.id = sysobjects.id AND sysobjects.name = '表名' 查询存储过程的依赖exec sp_depends SP名称 阅读全文

posted @ 2008-09-28 11:22 mrfangzheng 阅读(160) 评论(0) 推荐(0)

摘要:字符集charset : 定义一个集合中包含多少字符, 即哪些字符属于该字符集哪些不属于, 比如: ASCII, GBK, Unicode, 几乎所有其他字符集都包含ASCII字符集 编码encoding : 定义字符如何用字节存储, 比如: ASCII(也表示编码),GBK(也表示编码), Unicode(也表示编码), UTF8, UTF16 一个字符集有一种或者n种编码, 1:n 有时一个名... 阅读全文

posted @ 2008-09-11 20:55 mrfangzheng 阅读(676) 评论(0) 推荐(0)

摘要:本来SL应该嵌在HTML中运行, 如何在SL中嵌入HTML呢? 并且SL随着HTML的尺寸变化. 阅读全文

posted @ 2008-08-30 21:50 mrfangzheng 阅读(234) 评论(0) 推荐(0)