title: Cannot implement an interface member because it is not public
body: <p>I wrote some VB code that I converted to C# using Sharp Develop IDE. 
  I defined an Interface, <code>IElement</code>, that is implemented by objects that return XML representations of themselves. Any object that implements this interface should be able to return its TagName and it's XML string representation. To get the it's XML string, it may have to loop through its child/nested collection to get the XML representation of all of its child objects.</p>
  
  <p>Classes that inherit from Element can use the GetXml and GetNestedXml of its base class or choose to override it but the GetNestedXml function would not need to be public because it would only be called from the public GetXml function of derived classes. Therefore, in the original VB version, the scope of the GetNestedXML was set to protected. However, Sharp Develop and I have issues trying to convert this code to C#. Please see the error below.</p>
  
  <p>On a side note, I do realize that there might be better ways to implement this and I would be interested in side suggestions that are easy on flames. :-) Thanks.</p>
  
  <pre><code>Public Interface IElement
  
      ReadOnly Property TagName() As String
      ReadOnly Property GetXml(Optional ByVal targetXml As Integer = TargetXmlEnum.All) As String
      Function GetNestedXml() As String
  
  End Interface
  
  
  Public Class Element
  
      Implements IElement
  
      Public ReadOnly Property TagName() As String Implements IElement.TagName
          Get
              '....
          End Get
      End Property
  
       Public Overridable ReadOnly Property GetXml(Optional ByVal targetXml As Integer = TargetXmlEnum.All) _
              As String Implements IElement.GetXml
          Get
              '....
          End Get
      End Property
  
      Protected Overridable Function GetNestedXml() As String Implements IElement.GetNestedXml
          '....
      End Function
  
  End Class
  </code></pre>
  
  <p>Converted C# :</p>
  
  <pre><code>public interface IElement
  {
  
      string TagName { get; }
      string GetXml { get; }
      string GetNestedXml();
  
  }
  
  public class Element : IElement
  {
      public string TagName {
          get { //... }
      }
  
      public virtual string GetXml 
      {
          get 
          {
              //...
          }
      }
  
      protected virtual string GetNestedXml()
      {
          //...
      }
  }
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>Error   1   'Smit.SpreadsheetML.Element' does not implement interface member 'Smit.SpreadsheetML.IElement.GetNestedXml()'. 'Smit.SpreadsheetML.Element.GetNestedXml()' cannot implement an interface member because it is not public.   D:\Users\Chad\Desktop\SMIT\SMIT.SpreadsheetML.ConvertedToC#\Element.cs  41  24  Smit.SpreadsheetML.Converted
  </code></pre>