C#
文章平均质量分 72
__Fantasy
这个作者很懒,什么都没留下…
展开
-
C#中的特性,什么是特性.
什么是特性?特性(attribute)是一种允许我们向程序的程序集添加元数据的语言结构.它是用于保存程序结构信息的某种特殊类型的类. 将应用了特性的程序结构叫做目标. 设计用来获取和使用元数据的程序(对象浏览器)叫做特性的消费者 .NET预定了很多特性,我们也可以声明自定义特性.Obsolete特性(方法前):可以使用Obsolete原创 2017-03-23 15:09:23 · 13363 阅读 · 2 评论 -
23种设计模式-Abstract Factory(抽象工厂)设计模式
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;//依赖于抽象namespace _抽象工厂设计模式{ // 注意:设计一个程序需要仔细观察变化的轴线在哪里,然后进行进一步封装. /*1.如果没原创 2017-03-25 11:02:04 · 330 阅读 · 0 评论 -
23种设计模式-Builde(生成器)设计模式
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Builder生成器模式{ //不关心具体的表示,能够把这个里面那些高层抽象的东西,给他抽出来,先给他定下来. //设计一个系统原创 2017-03-25 18:39:29 · 604 阅读 · 0 评论 -
23种设计模式-FactoryMethod(工厂方法)设计模式
解决"单个对象"的需求变化,using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace FactoryMethod工厂方法模式_创建型模式_{ //一个设计成功的工程,当需求改变时,主逻辑和接原创 2017-03-25 23:10:18 · 387 阅读 · 0 评论 -
23种设计模式-Prototype(原型)设计模式
Prototype模式对于"如何创建易变类的实体对象"采用"原型克隆"的方法来做,它们使得我们可以非常灵活的动态创建"拥有某些稳定接口"的新对象 using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespa原创 2017-03-26 19:01:04 · 331 阅读 · 0 评论 -
23种设计模式-Adapter(适配器)设计模式
Adapter模式主要应用于"希望复用一些现存的类,但是接口又与复用环境要求不一致的情况",在遗留代码复用,类库迁移等方面非常有用.using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Col原创 2017-03-26 21:28:43 · 338 阅读 · 0 评论