Skip to content

Instantly share code, notes, and snippets.

@NiKiZe
Created September 2, 2021 16:51
Show Gist options
  • Save NiKiZe/b4a1d5962bb94b9127eafb0b9a6bdbb8 to your computer and use it in GitHub Desktop.
Save NiKiZe/b4a1d5962bb94b9127eafb0b9a6bdbb8 to your computer and use it in GitHub Desktop.
VB.NET Inheritance default
    public interface IName
    {
        /// <summary>Default property override</summary>
        [System.Runtime.CompilerServices.IndexerName("_Item")]
        object this[string key] { get; }
    }

    public class ImplNameCs : IName
    {
        [System.Runtime.CompilerServices.IndexerName("_Item")]
        public object this[string key]
        {
            get
            {
                return Item(key);
            }
        }
        
        public object Item(string key)
        {
            return new Object();
        }
    }
Public Class ImplNameVb
    Implements IName ' Missing implementation of members
    
    Default Public ReadOnly Property _Item(key As String) As Object Implements IName._Item ' Cannot resolve symbol _Item
        Get
            Return Item(key)
        End Get
    End Property
    
    Public Function Item(key As String) As Object Implements IName.Item
        Return New Object()
    End Function
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment