.NET
•  Greatis •  Security •  AppDatabase •  Utilities •  Delphi/CB • Visual Basic •  just4fun
.NET Software
.NET Components for Visual Studio .NET, Delphi 8, Delphi 2005 and Delphi 2006
 .NET     Entire site
More Info
Delphi to C#
Index

.NET
Form Designer .NET

See also
Delphi VCL software
Visual Basic 6 software
Hot Offer

Form Desigber .Net

Delphi to C#
Language
Interfaces

  Delphi  

       Interface declared as type, derived from some interface:
type
  INewInterface = interface
    ['{BE599288-2A1C-44CA-A5FA-1FDB40379A91}']
    function SomeFunction: Integer;
  end;
All interfaces are inherited from IUnknown, so if the ancestor is not specified, interface is derived from IUnknown. The following declarations are identical:
INewInterface = interface(IUnknown)
INewInterface = interface
Interface can be inherited when creating new interface:
type
  INewSpecialInterface = interface(INewInterface)
    ['{E14EE8E4-4900-41C6-BB2F-4FF824FF75B7}']
    function AnotherFunction: Boolean;
  end;
Interfaces can be realized in any class:
type
  TNewObject = class(TInterfacedObject,INewInterface,INewSpecialInterface)
  public
    // realization of interfaces methods
    function SomeFunction: Integer;
    function AnotherFunction: Boolean;
  end;
You can use aliases for realization interface methods:
type
  TNewObject = class(TInterfacedObject,INewInterface,INewSpecialInterface)
  public
    // alias declaration
    function INewInterface.SomeFunction = SomeClassFunction;
    function INewSpecialInterface.SomeFunction = SomeAnotherFunction;
    // class methods
    function SomeClassFunction: Integer;
    function AnotherClassFunction: Boolean;
  end;
If you have a property of an interface type (or a class type that implements the methods of an interface) you can use implements to specify that the methods of that interface are delegated to the object or interface reference which is the value of the property. Property type must relate to the class, realized needed interface, methods of this interface or interface inherited from needed interface:
type
  TNewObject = class(TInterfacedObject,INewInterface)
  public
    function GetSomeProperty: TNewInterfacedObject;
    property SomeProperty: TNewInterfacesObject read GetSomeProperty implements INewInterface;
  end;
 
 
  C#

Lost features     
Added features
Warnings
Additional information

 
 


Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2009 Greatis Software

eXTReMe Tracker