摘要: 学习博客园 lichdr的动态生成与编译系列文章http://www.cnblogs.com/lichdr/category/12610.htmlCodeCompileUnit compunit=new CodeCompileUnit() 生成可编译的单元。compunit.Namespaces.Add(sample) 添加名称空间命名空间CodeNamespace sample=new CodeNamespace("Sample") 定义一个名为Sample的命名空间sample.Imports.Add(导入名称空间)sample.Types.Add(添加类型)方法Cod 阅读全文
posted @ 2013-04-11 16:48 zscflying 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 最经学习CodeDom, 看了园子里的lichdr的文章,http://www.cnblogs.com/lichdr/archive/2004/10/25/56484.html#25911762004.10.25 (我落后太多了)按照其描述写成的代码:View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.CodeDom;using System.CodeDom.Compiler;using System.IO;using System.Co 阅读全文
posted @ 2013-04-08 17:17 zscflying 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 前言:毕业设计中需要用WPF展示三维图元,不适合使用XAML也不方便用Blend。于是在网上搜索相关内容找到一些资料,主要参考以下两位的博客:http://www.cnblogs.com/enjoyeclipse/archive/2012/03/21/2410439.htmlhttp://blog.sina.com.cn/s/blog_633d0e170100yte3.html总结如下(18::2—20:00):1.环境:vs2010,使用pro/e生成的obj模型,网上下载的WavefrontObjLoader.cs代码(前面给出的第一个文章中有下载http://www.cnblogs.co 阅读全文
posted @ 2013-02-26 18:50 zscflying 阅读(2101) 评论(0) 推荐(0) 编辑
摘要: C#using System;using System.Collections.Generic;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Shapes;using Sys 阅读全文
posted @ 2012-09-28 20:30 zscflying 阅读(988) 评论(0) 推荐(0) 编辑
摘要: View Code using System;namespace 控制台{ class MyEventArgs : EventArgs { public int EventNum; } delegate void MyEventHandler(MyEvent sender,MyEventArgs e); class MyEvent { static int count = 0; public event MyEventHandler SomeEvent; public void OnSomeEvent(... 阅读全文
posted @ 2012-09-18 09:06 zscflying 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 就像属性系统在Wpf中升级为依赖属性一样,事件系统在WPF中也被升级为路由事件(RoutedEvent),并在此基础上衍生出命令传递系统。WPF的UI是由布局组件和控件构成的树形结构。当这棵树上的某个节点激发出某个事件时,程序员可以选择一传统的直接事件模式让响应者来响应,也可以让让这个事件在UI组件树沿着一定的方向传递且路过多个中转节点,并在这个路由过程中被恰当地处理。XAML是以XML语言为基础、描述WPF人机界面的一种语言。XML是建立在DOM(document of model)之上的,在桌面应用程序中,其树根通常是Window元素;互联网应用程序中,其树根通常是Page元素。Wpf中的 阅读全文
posted @ 2012-07-27 22:47 zscflying 阅读(173) 评论(0) 推荐(0) 编辑
摘要: WPF中的颜色用Color结构表示,这个Color结构位于System.Windows.Media命名空间中。矩形的Fill属性为画刷Brush类型,当XAML遇到Fill=“····”的语句时,XAML引擎自动把引号里的字符串作为颜色值转换成SolidColorBrush,梯度画刷(GradientBrush)分为线性梯度画刷(LinearGradientBrush)和圆弧梯度画刷(RadialGradientBrush) 阅读全文
posted @ 2012-07-27 10:50 zscflying 阅读(344) 评论(0) 推荐(0) 编辑
摘要: WPF控件1内容控件:ContentControl直接从Control类中派生出来,内容控件的最大特征是含有一个Content属性,Content属性的类型是Object,因此内容控件可以是.Net的任何类。若Content属性是一个没有用户界面的类,WPF会调用Object类的ToString方法,从而在控件中显示字符串,如果Content是UI元素,WPF会调用OnRender方法,从而在控件中绘制出该UI元素。框架控件(Frame)框架控件的主要作用是将框架中的内容与界面上的其他部分分开,可含有任何东西,但只能有一个直接的子控件,Frame可以作为其他控件的子控件但是其宿主包容器的相关属 阅读全文
posted @ 2012-07-22 22:14 zscflying 阅读(1675) 评论(2) 推荐(1) 编辑
摘要: 初学《C#4.0完全参考手册》,在第15章的15.3.3在匿名方法中使用外部变量的示例程序中遇到一个小问题(程序是没有问题的)。实例程序如下View Code 1 using System; 2 3 4 namespace 练习 5 { 6 delegate int countit(int end); 7 class Program 8 { 9 static int sd()10 {11 return 0;12 }13 static countit counter()14 ... 阅读全文
posted @ 2012-07-01 09:06 zscflying 阅读(162) 评论(0) 推荐(0) 编辑