![ContractedBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![ExpandedBlockStart.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
2 //其实其实一个辅助的变量,用来做Hashtable中的”键“
3 private static object ValidateCreditCardFormKey = new object();
4 public event ValidateCreditCardFormEventHandler ValidateCreditCardForm
5 {
6 add
7 {
8 Events.AddHandler(ValidateCreditCardFormKey, value);
9 }
10 remove
11 {
12 Events.RemoveHandler(ValidateCreditCardFormKey, value);
13 }
14 }
15
16
17 protected void OnValidateCreditCardForm(ValidateCreditCardFormEventArgs args)
18 {
19 ValidateCreditCardFormEventHandler handler = Events[ValidateCreditCardFormKey]
20 as ValidateCreditCardFormEventHandler;
21 if (handler != null)
22 handler(this, args);
23 }