T
Tom
Hi
I defined a class, which contains a private class with properties to an
internal field. The private class is shown by an interface to outside of the
outer class. What can I do to prevent, that a variable of the interface typ
can be defined to make a reference to the internal class. Otherwise I want to
have access to the internal fields of the inner class directly from outside.
I make an example to give you more clarity:
Config, the outer class
Datas, the private class within Config, accessable over the property CFDATA
by the interface IDatas
Keyset, the field within Datas accessable by a property
Now I want to do the following:
Config.CFData.Keyset = 35; // direct-access
The following should not be possible:
Config.IData tmpcfg = Config.CFData; // define a reference
tmpcfg.Keyset = 35; // access by reference
....or the internal field Keyseet is not changed, when an access by reference
is made
Thanks
Tom
I defined a class, which contains a private class with properties to an
internal field. The private class is shown by an interface to outside of the
outer class. What can I do to prevent, that a variable of the interface typ
can be defined to make a reference to the internal class. Otherwise I want to
have access to the internal fields of the inner class directly from outside.
I make an example to give you more clarity:
Config, the outer class
Datas, the private class within Config, accessable over the property CFDATA
by the interface IDatas
Keyset, the field within Datas accessable by a property
Now I want to do the following:
Config.CFData.Keyset = 35; // direct-access
The following should not be possible:
Config.IData tmpcfg = Config.CFData; // define a reference
tmpcfg.Keyset = 35; // access by reference
....or the internal field Keyseet is not changed, when an access by reference
is made
Thanks
Tom