上一页 1 ··· 10 11 12 13 14

2017年8月5日

设计模式——策略模式

摘要: 声明:以下内容来源于《大话设计模式》,学习。 策略模式:定义了算法家族,分别封装起来,让它们之间可以互相替换,此模式让算法的变化,不会影响到使用算法的客户。 商场收费策略:正常收费、打折收费、返利收费。 类图如下: 代码: 阅读全文

posted @ 2017-08-05 12:03 苹果园dog 阅读(221) 评论(0) 推荐(0) 编辑

2017年7月23日

C#多进程并行

摘要: 为了并行执行多个任务,可以启动多个进程(并行数)。 下面提供两种方法,总任务数10,最大并行数4。 一、方法1 using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sy 阅读全文

posted @ 2017-07-23 18:19 苹果园dog 阅读(5827) 评论(1) 推荐(1) 编辑

C# Dynamic

摘要: Dynamic 类型可以绕过编译器的类型检查,改为在运行时解析。 例:类型A,B都有属性Name,Dodynamic的参数可以是A也可以是B, o.Name在编译时不会报错,在运行时根据传入的参数(A或B)执行A.Name或者B.Name 阅读全文

posted @ 2017-07-23 10:21 苹果园dog 阅读(172) 评论(0) 推荐(1) 编辑

2017年5月19日

数据绑定—Source(绑定到静态类的静态属性)

摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; u... 阅读全文

posted @ 2017-05-19 00:16 苹果园dog 阅读(290) 评论(0) 推荐(0) 编辑

2017年5月14日

WPF动画——故事板(Storyboard)

摘要: 1、XAML代码 <Window x:Class="故事板.MainWindow" x:Name="window" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.mi 阅读全文

posted @ 2017-05-14 21:50 苹果园dog 阅读(3628) 评论(0) 推荐(0) 编辑

2017年4月4日

List<T>的排序

摘要: 方法一、sort() (1)当list中存的是简单数据类型时; public void Sort(); (2)当list中存的是自定义数据类型时; public void Sort(Comparison<T> comparison); 其中参数Comparison<T>委托的定义为: public 阅读全文

posted @ 2017-04-04 17:52 苹果园dog 阅读(2083) 评论(0) 推荐(1) 编辑

上一页 1 ··· 10 11 12 13 14

导航