<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:DE;}
span.kwd
        {mso-style-name:kwd;}
span.pln
        {mso-style-name:pln;}
span.typ
        {mso-style-name:typ;}
span.pun
        {mso-style-name:pun;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hello out there,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I’ve come across an issue with calling a method of an instance which ends up being an explicitly implemented interface method. Let me explain with a very brief example:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Consider this a very basic interface:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">[File: ISomeInterface.cs]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">namespace</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 PythonInterfaceCalls<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">   
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">public</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">interface</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">ISomeInterface</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">void</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> ImplicitImplementation();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">void</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> ExplicitImplementation();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">And here’s an implementing class. Note one of the methods being implicitly implemented, the other being explicitly implemented:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">[File: SomeImplementation.cs]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 System;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">namespace</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 PythonInterfaceCalls<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">   
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">public</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">class</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">SomeImplementation</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">:
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">ISomeInterface</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">public</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">void</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> ImplicitImplementation()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">           
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Console</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">.WriteLine(</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white">"Call
 of implicitly implemented interface method."</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">void</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">ISomeInterface</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">.ExplicitImplementation()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">           
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Console</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">.WriteLine(</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white">"Call
 of explicitly implemented interface method."</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Note the method headers. While the implicit implementation is (and has to be) public, the explicit implementation is (and has to be) internal. Both methods work well in C# (as long as the instance is casted into the interface
 type). See the unit tests, both passing:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">[File: TestImplementation.cs]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 System;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 System.IO;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 NUnit.Framework;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">namespace</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 PythonInterfaceCalls<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    [</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">TestFixture</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">   
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">public</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">class</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">TestImplementation</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        [</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Test</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">public</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">void</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> TestImplicitCall()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">           
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">var</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> implementation
 = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">new</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">SomeImplementation</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">()
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">as</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">ISomeInterface</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">           
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">StringWriter</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 sw = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">new</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">StringWriter</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">())<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">            {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">               
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Console</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">.SetOut(sw);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">                implementation.ImplicitImplementation();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">               
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Assert</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">.AreEqual(</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white">"Call
 of implicitly implemented interface method.\r\n"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">, sw.ToString());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">            }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        [</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Test</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">public</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">void</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> TestExplicitCall()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">           
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">var</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> implementation
 = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">new</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">SomeImplementation</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">()
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">as</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">ISomeInterface</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">           
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> (</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">StringWriter</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 sw = </span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">new</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">StringWriter</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">())<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">            {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">               
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Console</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">.SetOut(sw);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">                implementation.ExplicitImplementation();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">               
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Assert</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">.AreEqual(</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;mso-highlight:white">"Call
 of explicitly implemented interface method.\r\n"</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">, sw.ToString());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">           
</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">This should be solvable using the following method to access all interface members, not just the publicly available ones:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">[File: InterfaceMembersExtension.cs]<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 System;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 System.Collections.Generic;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">using</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 System.Reflection;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">namespace</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
 PythonInterfaceCalls<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">   
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">public</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">static</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">class</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">InterfaceMembersExtension</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">public</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">static</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">IList</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"><</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">MethodInfo</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">>
 GetImplementedMethods(</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">this</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Type</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> targetType,
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white">Type</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> interfaceType)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">        {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">           
</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">return</span><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> targetType.GetInterfaceMap(interfaceType).TargetMethods;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">       
</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">    }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Please find the complete solution attached to this mail.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Is there a chance that this will be implemented in PythonNet?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hennnig<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>