C-Sharp Mapping for Local Interfaces
On this page:
Mapped C# Class
A Slice local interface is mapped to a C# interface with the same name, for example:
Slice
module Ice { local interface Communicator { ... } }
is mapped to the C# interface Communicator
:
C#
namespace Ice { public partial interface Communicator { ... } }
The delegate
metadata allows you to map a local interface with a single operation to a C# delegate. For example:
Slice
module Ice { ["delegate"] local interface ValueFactory { Value create(string type); } }
is mapped to:
C#
namespace Ice { public delegate Value ValueFactory(string type); }
LocalObject in C#
All Slice local interfaces implicitly derive from LocalObject
, which is mapped to System.Object
in C#.
Mapping for Local Interface Inheritance in C#
Inheritance of local Slice interfaces is mapped to interface inheritance in C#. For example:
Slice
module M { local interface A {} local interface B extends A {} local interface C extends A {} local interface D extends B, C {} }
is mapped to:
C#
namespace M { public partial interface A {} public partial interface B : A {} public interface C : A {} public interface D : B, C {} }