成都新南门汽车站时刻表,18av波多野结衣,搞笑故事大全
class command
{
public virtual void execute() { }
}
class invalidoperationexception<t> : invalidoperationexception
where t : command
{
public invalidoperationexception(string message) : base(message) { }
// some specific information about
// the command type t that threw this exception
}
static class commandextensions
{
public static void throwinvalidoperationexception<tcommand>(
this tcommand command, string message)
where tcommand : command
{
throw new invalidoperationexception<tcommand>(message);
}
}
class copycommand : command
{
public override void execute()
{
// after something went wrong:
this.throwinvalidoperationexception("something went wrong");
}
}
class cutcommand : command
{
public override void execute()
{
// after something went wrong:
this.throwinvalidoperationexception("something else went wrong");
}
}
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
网友评论