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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:49:01+00:00 2026-05-15T13:49:01+00:00

I was wondering if it was impossible to set up an accessor to allow

  • 0

I was wondering if it was impossible to set up an accessor to allow you to access the accessor’s variable..
Example of an error:

    public void Main()
    {
        Object.name = "test"; //Can't access the object's subproperties
    }

    Objec ob = new Objec();
    public Objec Object
    {
        get { return ob; }
        set { ob = value; }
    }
class Objec
{
    string name;
    string value;
}

Is there anyway to do the above (other than making accessors for every value)?
Thanks,
Max

EDIT: Here is a better example

    public void Main()
    {
        //Now I can't change the X or Y properties, this will display an error
        ThePoint.X = 10;
        //To change the x value, I need to do the following:
        ThePoint = new Point(10,0);
    }

    private Point Poi = new Point();
    public Point ThePoint
    {
        get { return Poi; }
        set { Poi = value; }
    }

Is there a way to make ‘ThePoint.X’ work (without just publicly displaying ‘Poi’)?

  • 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-15T13:49:01+00:00Added an answer on May 15, 2026 at 1:49 pm

    The answer to your actual question “Is there anyway to do the above (other than making accessors for every value)?” is NO.

    Guessing a bit on your intentions, you seem to want to follow a design pattern known as Bridge (your class is an abstraction around the implementation of Object and/or Point). You will only expose to your class’ audience the pieces of the original implementation that you want, in your question’s case, every value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering how I should be testing this sort of functionality via NUnit. Public
In C++03 it is impossible to return an object of a class having a
Having trouble with this code, wondering if I'm trying to achieve something impossible. I'm
I am wondering should I write unit test for everything. There are some classes
I'm wondering how I can catch any raised object (i.e. a type that does
This may be impossible, but I was wondering if it was possible to keep
I was wondering the best way to do the following, Create many buttons. Allow
I was wondering if I could have the parent class instantiate an object of
While watching the rugby last night I was wondering if any scores were impossible
Just wondering. Or is it even technically impossible to write me, e.g. because iOS

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.