Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 357231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:11:10+00:00 2026-05-12T12:11:10+00:00

I found the following syntax as a VB.NET property and I’m trying to convert

  • 0

I found the following syntax as a VB.NET property and I’m trying to convert it to c#, but I’m not sure how to accomplish that.

Public Property SomeText(ByVal someEnumThing as SomeEnum) As String
    Get
        Select Case someEnumThing
            //figure out what string to return
        End Select
    End Get
    Set(ByVal Value as String)
        Select Case someEnumThing
            //figure out what string to set
        End Select
    End Set
End Property

I’ve never seen a property done like this before, any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T12:11:10+00:00Added an answer on May 12, 2026 at 12:11 pm

    I guess you’re referring to the arguments for the property. Well, as far as I know, C# only supports them for indexers, which cannot have a name (e.g. this[SomeEnum someEnumThing] {}).

    If you want to get a similar behavior, you can create a helper class with an indexer property and use it to expose the “name” of the property:

    public class YourClass {
        public struct SomeTextProperty {
            private readonly YourClass owner;
    
            internal SomeTextProperty(YourClass owner) {
                this.owner = owner;
            }
    
            public string this[SomeEnum someEnumThing] {
                get {
                    return owner.GetSomeText(someEnumThing);
                }
                set {
                    owner.SetSomeText(someEnumThing, value);
                }
            }
        }
    
        public SomeTextProperty SomeText {
            get {
                return new SomeTextProperty(this);
            }
        }
    
        private string GetSomeText(SomeEnum someEnumThing) {
            // implementation to get it
        }
    
        private void SetSomeText(SomeEnum someEnumThing, string value) {
            // implementation to set it
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently found that ( http://www.javabeat.net/articles/30-annotations-in-java-50-2.htmlthe )syntax of the @Override annotation is @Retention(RetentionPolicy.CLASS) @Target(ElementType.RUNTIME)
I found here the following syntax: <%=h @person.first_name %> What does the h means
The new hash syntax in Ruby 1.9.2 means that I can do the following:
I am using asp.net mvc 3 client validation. I am trying to do some
I'm trying to port a classic ASP.NET MVC view to Razor and got stuck
I've got following class and template function: template <size_t num> class String{ public: char
I have The Following Javascript Error Line 2 Character 1 coming in the entire
I've been looking around via Google for some pointers to get me going on
I have created a WCF service, now this WCF service has to call a
Greetings, I am attempting to remove multiple documents from a MongoDB collection using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.