zoukankan
html css js c++ java
编程要素
Interface, Event, Wrapper
Code
//
an interface
public
interface
IOperator
{
event
EventHandler OperationCompleted;
void
Operate();
}
//
a base implementation
public
class
OperatorBase : IOperator
{
public
event
EventHandler OperationCompleted;
public
virtual
void
Operate()
{
throw
new
Exception(
"
Not implemented
"
);
}
protected
virtual
void
OnOperationCompleted(EventArgs e)
{
if
(
this
.OperationCompleted)
{
this
.OperationCompleted(
this
, e);
}
}
}
//
a wrapper base
public
class
OperatorWrapperBase : IOperator
{
IOperator mWrappee;
public
OperatorWrapperBase(IOperator wrappee)
{
this
.mWrappee
=
wrappee;
}
public
IOperator Wrappee
{
get
{
return
mWrappee;}
}
public
virtual
void
Operate()
{
this
.Wrappee.Operate();
}
public
event
EventHandler OperationCompleted
{
add
{
this
.Wrappee.OperationCompleted
+=
value; }
remove
{
this
.Wrappee.OperationCompleted
-=
value; }
}
}
查看全文
相关阅读:
ansible plugins 列表
ansible common modules
CentOS 7.3降低内核版本为7.2
ansible ad-hoc 参考
kafka监控工具kafka-manager
zookeeper监控之taokeeper
linux的ulimit各种限制之深入分析
docker版的zabbix部署
kubernetes介绍(1)
部署k8s时容器中ping不通
原文地址:https://www.cnblogs.com/mrfangzheng/p/1165225.html
最新文章
Shell笔记-03
Shell笔记-02
Shell笔记-01
Loadrunner手动关联详解
Mysql数据库写入数据速度优化
Spotlight On Oracle安装和使用
Http_load的安装和使用
Mysql慢查询
对称加密和非对称加密
左连接,右连接和等值连接(left join,right join和inner join)
热门文章
windows下Mysql忘记root密码
浅谈MVC和MTV
Python创建virtualenv(虚拟环境)方法
浅谈CSRF(Cross-site request forgery)跨站请求伪造(写的非常好)
Python内部类,内部类调用外部类属性,方法
仿优酷作业
Pycharm常用快捷键,以及设置
ansible使用jinja2管理配置文件以及jinja2语法简介
ansible galaxy
ansible inventory
Copyright © 2011-2022 走看看