摘要: 1.理论定义 观察者模式 描述了 一种 一对多的关系。 当某一对象的状态发生改变时,其他对象会得到 改变的通知。并作出相应的反应。 2.应用举例 需求描述:牛顿同学的期末考试成绩(Score)出来了,各科老师都想知道自己的 学生 成绩情况! 语文老师(TeacherChinese)只关心 牛顿的语文(Chinese)成绩. 英语老师(TeacherEnglish)只关心 牛顿的英语(English)成绩. 数学老师(TeacherMathematics)只关心 牛顿的数学(Mathematics)成绩. 班主任想关心(TeacherTeacherHead) 牛顿的各科成绩和总成绩(Tota.. 阅读全文
posted @ 2012-07-30 11:49 正定聚 阅读(1830) 评论(7) 推荐(2) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Web;using System.Data.SqlClient;using System.Configuration;using System.Diagnostics;namespace XXX.XXX{ /// <summary> /// 页面名 :数据库操作类<br/> /// 说明 :<br/> /// 作者 :niu<br 阅读全文
posted @ 2012-07-26 09:37 正定聚 阅读(856) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections;using System.Collections.Generic;using System.Text;using System.Data;using System.Reflection;using System.ComponentModel;using System.Diagnostics;namespace XXX.XXX{ /// <summary> /// 数据转换类 /// 说明 :实体,List集合,DataTable相互转换<br/> /// 作者 :niu<br/> . 阅读全文
posted @ 2012-07-26 09:24 正定聚 阅读(4663) 评论(2) 推荐(1) 编辑
摘要: /// <summary> /// 单例模式 /// </summary> public sealed class Singleton<T> where T:new() { private Singleton() { }//防止new对象 public static T Instance { get { return SingletonCreator.instance; }//延迟加载 } internal class SingletonCreator { static SingletonCreator() { } internal static reado 阅读全文
posted @ 2012-07-25 17:20 正定聚 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 发现一现象,火狐,IE,首先要设置字体,再设置行高,不然 行高不起作用 font:normal 12px 宋体; line-height:25px; ----字体特性一起设置,此时行高要放字体后面 但是如果把 font:normal 12px "宋体";分别设置,这时候line-height可以放任何地方。 font-weight:normal; font-size:12px; font-family:宋体; line-height:25px; ---字体分别设置,此时行高可以置于任何地方 阅读全文
posted @ 2012-01-31 15:46 正定聚 阅读(294) 评论(0) 推荐(0) 编辑
摘要: body { background-color:Black;/*火狐+Google*/ background-color:red\9\0;/*IE9*/ background-color:blue\0;/*IE8*/ *background-color:red;/*IE7,IE6*/ +background-color:navy;/*IE7*/ _background-color:green;/*IE6*/}注意点: IE9 支持 \9\0, 中间不要有空格,写成 background-color:red \9\0;不会识别。必须 background-color:red\9\0; IE8 支 阅读全文
posted @ 2012-01-14 18:18 正定聚 阅读(727) 评论(0) 推荐(0) 编辑
摘要: #footer{width:500px;height:220px;background-color:Red}div.footer2{width:500px;height:220px;background-color:gray}<div id="footer" class="footer2" style="background-color:blue" ></div>上面的div背景 最终将显示 内联样式style的 blue如果去掉style属性<div id="footer" clas 阅读全文
posted @ 2012-01-14 17:50 正定聚 阅读(1558) 评论(0) 推荐(0) 编辑