c# 4.0 - How to find the parent object from the child(property) object in C#? -


i have situation child able reference parent. reason want child have ability update parent object.

configuration.range.next(configuration)

i not want pass parent object reference instead range object should able find parent object. how this?

class range { ....methodx(){how access configuration object here } }

class configuration { public range range{get;set;} ..... }

part of difficulty answering question people use terms "child" , "parent" mean different things different people.

one of common uses of terms synonyms subclass (child) , superclass (parent) in inheritance structure. assuming meaning, have access superclass (i.e. "parent") declared public or protected. example:

public class parent {     protected int foo { get; set; } }  public class child : parent {     public void dosomething()     {         foo = 42;         // or         base.foo = 42;     } } 

if isn't situation you're working please add more information original question better describe mean when use terms "child" , "parent."


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -