摘要:
是某类型: if (this.FindName(ControlName).GetType() == typeof(LabelIMG)) { }具有某接口: if (this.FindName(ControlName).GetType().GetInterface("IControl",true) == typeof(IControl)) { } 阅读全文
摘要:
using System;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Ink;using System.Windows.Input;using System.Windows.Media;using Sys... 阅读全文
摘要:
using System;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Ink;using System.Windows.Input;using System.Windows.Media;using Sys... 阅读全文
摘要:
using System;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Ink;using System.Windows.Input;using System.Windows.Media;using Sys... 阅读全文
摘要:
using System;using System.Linq;using System.Web;using System.Collections.Generic;namespace SVL{ [Serializable] public class TableForGen { public string TableName; public ColumnInfo[] Columns; public T... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Services;namespace WebService1{ /// <summary> /// Service1 的摘要说明 /// </summary> [WebServic... 阅读全文
摘要:
状态模式using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace State{ public interface State { //投入25分硬币 void insertQuarter(); //退出硬币 void ejectQuarter(); //推把手 void t... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Strategy{ /// summary /// 具有飞行行为 /// /summary public interface FlyBehavior { void fly(); } /// summary /// 具有吃饭行为 /// /summary public interface EatBehavior { void eat(); } /// summary /// 用翅膀飞 /// 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace SingleTon{ public sealed class SingleObject { //公有字段 public string name; //类似java的实现 private static object s... 阅读全文
摘要:
观察者,被观察实时数据推送给观察者using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Observer{ interface Subject { void register(Observer o); void remove(Observer o); void notify(); } interface Observer { void update(float temp); } interface Dispaly { void display(); }}using 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace Iterator{ public class Item { string name; double price; public Item(string n, double p) { this.name = n; this.price = p; } public string getName() { return name; } public double get 阅读全文
摘要:
饮料的包装using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Decorator{ //抽象组件类 饮料 public abstract class Beverage { public string description = "未知描述"; public Size size; public abstract Size getsize(); public abstract string getDescription(); public abstract doubl 阅读全文
摘要:
用一个控制器(带有几个开关)来控制所有的电器?神奇而简单的实现:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Command{ public interface Command { void execute(); void execute1(); void execute2(); }}using System;using System.Collections.Generic;using System.Linq;using System.Text;namesp 阅读全文
摘要:
原作是把一只火鸡通过一个适配器,出来后就是一只鸭,神奇。改成C#的代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Adapter{ /// summary /// 鸭子接口 /// /summary public interface Duck { //可以咵咵的叫 void quack(); void fly(); } /// summary /// 火鸡接口 /// /summary public interface Turkey { 阅读全文
该文被密码保护。 阅读全文
摘要:
using Microsoft.Office.InfoPath;using System;using System.Xml;using System.Xml.XPath;namespace 模板2{ public partial class FormCode { // 启用浏览器功能的表单不支持成员变量。 // 请使用代码从 FormState 词典 // 写入和读取这些值,如下所示: // /... 阅读全文
该文被密码保护。 阅读全文
摘要:
using Microsoft.Office.InfoPath;using System;using System.Xml;using System.Xml.XPath;using System.Data;using System.Threading;namespace 模板1{ public partial class FormCode { // 启用浏览器功能的表单不支持成员变量。 // 请使... 阅读全文