Observer ¹Û²ìÕßģʽ £¨HeadFirstÉè¼ÆÄ£Ê½ c#£©
Observer.cs
using System;
using System.Text;
using System.Collections.Generic;
namespace Observer
{
public interface ISubject
{
void RegisterObserver(IOvserver o);
void RemoveObserver(IOvserver o);
void NotifyObserver();
}
public interface IOvserver
{
void update(float temp, float humidity, float pressure);
}
public interface IDisplayElement
{
void display();
}
public class WeatherData:ISubject
{
private List<IOvserver> obList;
private float temperature;
private float humidity;
private float pressure;
public WeatherData()
{
obList = new List<IOvserver>();
}
public void RegisterObserver(IOvserver o)
{
obList.Add(o);
}
public void RemoveObserver(IOvserver o)
{
if (obList.IndexOf(o) >= 0)
{
&nb
Ïà¹ØÎĵµ£º
Ê×ÏÈдһ¸öÒ³Ãæ£¬ÉÏÃæÒª·ÅÒ»¸öButton
<html>
<head>
<title></title>
</head>
<body>
<input id="Button1" type="button" value="button" />
</body>
</html>
½«Æä±£´ ......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
//sqlserverÉí·ÝÑéÖ¤
//s ......
²Î¿¼¡¶ASP.NETÓëSQLÒ»Æð´ò°ü²¿Êð°²×°¡·
£¬ÕâÆªÎÄÕÂÊÇÕë¶ÔVB.NETÓëSQL Ò»Æð´ò°üµÄ,µ«ÊÇÎÒʹÓõÄÊÇC#,µ±È»Ö»ÒªÐÞ¸ÄÒ»ÏÂÖ÷Òª°²×°Àà¿â¾ÍÐÐÁË!C#µÄÀà¿â´úÂëÈçÏÂ:DBCustomAction.cs
using System;
using System.Collections;
using System.Data.SqlClient;
using System.ComponentModel;
using System.Configuration.Inst ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;//CryptographyÃÜÂëÊõ
namespace DAL
{
public class Enc ......