缩短命令?

时间:2009-12-06 06:49:52

标签: c# command

是否可以缩短命令,例如......

this.ExampleCommand1.ExampleCommand2.1;
this.ExampleCommand1.ExampleCommand2.2;
this.ExampleCommand1.ExampleCommand2.3;

ExampleShorten = "this.ExampleCommand1.ExampleCommand2";
ExampleShorten.1;
ExampleShorten.2;
ExampleShorten.3;

1 个答案:

答案 0 :(得分:2)

var ExampleShortened = this.ExampleCommand1.ExampleCommand2;
ExampleShortened.1;
ExampleShortened.2;
ExampleShortened.3;