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 924173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:18:18+00:00 2026-05-15T19:18:18+00:00

There is a public interface in the project with a value as follows: Name3D

  • 0

There is a public interface in the project with a value as follows:

Name3D MyName3D { get; set; }

Now in another location I am using a public sealed class, I added the namespace / using System.Interfacename. Now I want to set it like follows:

private readonly Interfacename m_MyName3D ;
private const string 3DName = ##;

How would i go aobut setting it up so ## is the value of MyName3D. Again I haven’t done anything like this before. Just wanted to give it a try?

Would be really appreciated if I could get some detail onto how it works.

Update One

Do you mean this?

using Interfacename;

public sealed class InfoController : AsyncController
{
    private readonly Interfacename m_MyName3D ;
    private const string 3DName = ##;
  • 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-15T19:18:18+00:00Added an answer on May 15, 2026 at 7:18 pm

    You can not assign anything to a const member at runtime. You can however make 3DName a readonly property and relay the get accessor to the interface:

    private string 3DName { get { return m_MyName3D.MyName3D; } }
    

    But maybe I did not get what you are trying to do, if so please describe it more clearly.

    edit: you are using two types for 3DName, Name3D and string. If Name3D has no conversion operators you need to use it throughout the property.

    private Name3D 3DName { get { return m_MyName3D.MyName3D; } }
    

    If you really need to return a string the you need to write a string conversion operator for Name3D:

    struct/class Name3D
    {
      public static implicit operator string(Name3D name)
      {
          return name.whatever; // this needs to be the data holding member(s) of Name3D
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there public interface in SDK 3.* to start video recording programmatically? Also how
public Interface Foo<T extends Colors>{...} Is there a way to retrieve which T was
In my current project I'm using classes which implement the following ITransaction interface shown
in my mvvm project there is one interface which contain add,update,delete interface.therefore interface is
I wrote two methods to check there performance public class Test1 { private String
I like to know is there any specific reason that there is no public
UPDATE Guid.TryParse is available in .NET 4.0 END UPDATE Obviously there is no public
There is this code: class SomeClass { public: SomeClass(){} SomeClass(SomeClass& b){} SomeClass(SomeClass&b, SomeClass& c){}
Is there a runtime performance differance between public and private variables/methods? I know that
There is a class - it's a common class nothing special: public class Trader{

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.