12 2012 档案

摘要:很多时候,我们在选择循环的时候,会考虑用那个循环好一点,这个好一点就是指效果高一点!今天我对于for, foreach循环做了个性能测试,测试代码如下:// Performance test of for loop. private void ForLoopPerformance() { System.Diagnostics.Debug.WriteLine("ForLoopPerformance: ");string[] array = new string[10000000];DateTime d1 = DateTime.Now; for (int i = 0; i &l 阅读全文
posted @ 2012-12-31 17:32 nchxmoon 阅读(12885) 评论(1) 推荐(0) 编辑
摘要:我们在写WPF控件的时候,经常会需要在xaml文件添加一些引用, 如System.Windows.Forms引用,但是在xaml文件没有提供类似于 using System.Windows.Forms; 的语法, 因此我们需要通过 xmlns关键字来添加引用。具体实现如下:xmlns:wf="clr-namespace:System.Windows.Forms; assembly=System.Windows.Forms"其中: wf为引用别名,在xaml文件中,可以用wf来代替该引用; clr-namespace:引用名字; assembly=引用对应的DLL名字 阅读全文
posted @ 2012-12-31 11:27 nchxmoon 阅读(3683) 评论(0) 推荐(1) 编辑
摘要:分享一个“一起学习winphone7”系列课程,主讲:李振,感兴趣的朋友可以通过下面的链接下载!每一小节包括视频和例子!http://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/Series/WP7.aspx 阅读全文
posted @ 2012-12-28 21:19 nchxmoon 阅读(174) 评论(0) 推荐(0) 编辑
摘要:效果图: wpf control + form = custom control. + = 设计与实现: 1. 按照上面的效果图,分别设计一个WPF控件和一个Windows Form窗口;这一步很简单,下面两步很重要! 2. 在frmHost.Designer.cs文件中添加如下代码: private System.Windows.Forms.Integration.ElementHost m_elementHost; // 元素宿主 private ctlEmbed m_ctlEmbed; // wpf控件 3. 在frmHost.cs文件中添加如下代码: ... 阅读全文
posted @ 2012-12-28 17:27 nchxmoon 阅读(1257) 评论(0) 推荐(0) 编辑