摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//顺序栈类SeqStack<T>的实现说明如下所示。publicclassSeqStack<T>:IStack<T>{privateintmaxsize;//顺序... 阅读全文
posted @ 2010-04-07 15:35 Blue Sky ...... 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--///<summary>///二叉树的应用///</summary>///<typeparamname="T"></typeparam>publiccl... 阅读全文
posted @ 2010-04-07 15:34 Blue Sky ...... 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->一.数据访问接口usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingNHibernate.Criterion;namespaceCuyahoga.Core.DataAccess{publicinterfaceICommonDao{objectGetObjectById(Typetype,intid) 阅读全文
posted @ 2010-04-07 15:32 Blue Sky ...... 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//泛型约束接口usingSystem;usingSystem.Collections.Generic;usingCuyahoga.Core.Domain;usingNHibernate.Criter... 阅读全文
posted @ 2010-04-07 15:31 Blue Sky ...... 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--在Cuyahoga项目中,NHibernate中关联关系在权限中得到了很好的体现。User用户Role角色:比如管理员,会员,游客等Right权限:比如文章的增,删,改Site站点项目中的三者之间的关... 阅读全文
posted @ 2010-04-07 15:29 Blue Sky ...... 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Many-To-Many双向关联1.双向N——N关联的两边都需要指定连接表的表名,外键列的列名。2.两个set元素table必须指定,并且必须相同。3.set元素的两个字元素:key和many-to-many都必须指定column属性,key和many-to-many分别制定本持久化类,关联类在连接表中的外键列名,因此两边的key与many-to-many的column属性交叉相同。例如: 阅读全文
posted @ 2010-04-07 15:27 Blue Sky ...... 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--NHibernate主键生成方式映射文件的Generator节点Hibernate主键生成方式KeyGenerator主键产生器可选项说明:1)assigned主键由外部程序负责生成,无需Hibern... 阅读全文
posted @ 2010-04-07 15:26 Blue Sky ...... 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingNHibernate;usingN... 阅读全文
posted @ 2010-04-07 15:23 Blue Sky ...... 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--NHibernate.cfg.xml文件配置<?xmlversion="1.0"encoding="utf-8"?><hibernate-configurationxmlns="ur... 阅读全文
posted @ 2010-04-07 15:22 Blue Sky ...... 阅读(537) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//接口publicinterfaceIQueue<T>{intGetLength();//求队列的长度boolIsEmpty();//判断对列是否为空voidClear();//清空队列... 阅读全文
posted @ 2010-04-07 15:20 Blue Sky ...... 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//可枚举对象并非必须实现IEnumerable接口。该职责可以委托给第三个类来实现。publicclassPersons{string[]m_Names;publicPersons(paramsst... 阅读全文
posted @ 2010-04-07 15:19 Blue Sky ...... 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//链堆栈的接口定义如下所示。publicinterfaceIStack<T>{intGetLength();//求栈的长度boolIsEmpty();//判断栈是否为空voidClear... 阅读全文
posted @ 2010-04-07 15:19 Blue Sky ...... 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--/*-------------实现类对象的枚举遍历如果希望枚举一个可枚举对象(实现IEnumerable接口)的元素,就可以通过IEnumerable接口的GetEnumerator()*方法从可枚举... 阅读全文
posted @ 2010-04-07 15:18 Blue Sky ...... 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--单链表结点类的实现如下所示。publicclassNode<T>{privateTdata;//数据域privateNode<T>next;//引用域//构造器publicNo... 阅读全文
posted @ 2010-04-07 15:17 Blue Sky ...... 阅读(887) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--单元测试方法之间没有依赖关系一个方法可能对应多个测试方法[TestFixture]类前标注时NUnit会自动加载该类[Test]标注测试方法。测试方法必须为public,void,没有参数[Ignor... 阅读全文
posted @ 2010-04-07 15:15 Blue Sky ...... 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1.根据查询结果构建实体类公共接口publicinterfaceIEntityTranslate{///用class关键字表示约束为引用类型///用struct关键字表示约束为值类型TEntityTr... 阅读全文
posted @ 2010-04-07 15:13 Blue Sky ...... 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--///<summary>///默认构造函数约束///</summary>///<typeparamname="U"></typeparam>public... 阅读全文
posted @ 2010-04-07 15:11 Blue Sky ...... 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--publicclassYieldReturn{//yieldreturn用于无缝实现迭代模式。string[]strArr;publicYieldReturn(paramsstring[]arr){s... 阅读全文
posted @ 2010-04-07 15:10 Blue Sky ...... 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--publicclassPerson{privatestringm_name;privateintm_birthday;publicPerson(stringname,intbirthday){m_na... 阅读全文
posted @ 2010-04-07 15:09 Blue Sky ...... 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/------DataReader转换为实体的泛型类---注意数据库表字段名和实体类相同publicclassEntityTranslate{///用class关键字表示约束为引用类型///用struct关... 阅读全文
posted @ 2010-04-07 15:08 Blue Sky ...... 阅读(460) 评论(0) 推荐(0) 编辑