有关显式徽商期货程序化交易接口,接口实现的更多详细信息和代码示例,请参见显式徽商期货程序化交易接口,接口实现。
当基类型列表包含基类和徽商期货程序化交易接口,接口时,基类必须是列表中的第一项。
interfaceIPoint{//Propertysignatures:intx{get;set;}inty{get;set;}}classPoint:IPoint{//Fields:privateint_x;privateint_y;//Constructor:publicPoint(intx,inty){_x=x;_y=y;}//Propertyimplementation:publicintx{get{return_x;}set{_x=value;}}publicinty{get{return_y;}set{_y=value;}}}classMainClass{staticvoidPrintPoint(IPointp){ConsolWriteLine('x={0},y={1}',p.x,p.y);}staticvoidMain(){Pointp=newPoint(2,;ConsolWrite('MyPoint:');PrintPoint(p);}}//Output:MyPoint:x=2,y=3
interfaceISampleInterface{voidSampleMethod();}classImplementationClass:ISampleInterface{//Explicitinterfacememberimplementation:voidISampleInterfacSampleMethod(){//Methodimplementatio}staticvoidMain(){//DeclareaninterfaceinstancISampleInterfaceobj=newImplementationClass();//Callthemember.obSampleMethod();}}
一个徽商期货程序化交易接口,接口可从一个或多个基徽商期货程序化交易接口,接口继承。
徽商期货程序化交易接口,接口可以是命名空间或类的成员,并且可以包含下列成员的签名:
方法属性索引器事件
实现徽商期货程序化交易接口,接口的类可以显式实现该徽商期货程序化交易接口,接口的成员。显式实现的成员不能通过类实例访问,而只能通过徽商期货程序化交易接口,接口实例访问。
徽商期货程序化交易接口,接口只包含方法、属性、事件或索引器的签名。实现徽商期货程序化交易接口,接口的类或结构必须实现徽商期货程序化交易接口,接口定义中指定的徽商期货程序化交易接口,接口成员。在下面的示例,类ImplementationClass必须实现一个不具有参数并返回void的名为SampleMethod的方法。
文章为作者独立观点,不代表股票交易接口观点