T
TZ
I have two classes, UIHousehold and WIZEditHousehold (both are
winforms).
UIHousehold creates and shows the WIZEditHousehold (WIZEditHousehold
can't be modal, so UIHousehold doesn't know when WIZEditHousehold
closes).
A reference to a buffer within UIHousehold is supplied (passed by REF)
to the constructor of WIZEditHousehold - that constructor saves the
reference to the buffer in a member variable.
OnClose, the WIZEditHousehold attempts to change the reference to the
buffer. That change is not working (the changes are never seen in
UIHousehold).
Here's pseudocode:
class WIZEditHousehold
{
BufferClass _fromUIHousehold;
BufferClass _changedInWizard;
WIZEditHousehold(ref BufferClass bufferFromUIHousehold)
{
_fromUIHousehold = bufferFromUIHousehold;
}
OnClose()
{
_fromUIHousehold = _changedInWizard;
}
}
OnClose, _fromUIHousehold values change in WIZEditHousehold, but these
values are NOT changed in UIHousehold's instance of BufferClass.
In summary, my problem is that I want to change the BUFFER POINTER, but
C# is treating _fromUIHousehold as a Pass By Value reference, not a
true reference (modifiable pointer).
I can accomplish this task via interfaces, upgrading BufferClass, or
events, but my proposed solution is much easier to code for the
multitudes of wizards and buffers I'm developing. Are there any ways
to allow me to treat _fromUIHousehold as a modifiable pointer to
UIHousehold's buffer?
winforms).
UIHousehold creates and shows the WIZEditHousehold (WIZEditHousehold
can't be modal, so UIHousehold doesn't know when WIZEditHousehold
closes).
A reference to a buffer within UIHousehold is supplied (passed by REF)
to the constructor of WIZEditHousehold - that constructor saves the
reference to the buffer in a member variable.
OnClose, the WIZEditHousehold attempts to change the reference to the
buffer. That change is not working (the changes are never seen in
UIHousehold).
Here's pseudocode:
class WIZEditHousehold
{
BufferClass _fromUIHousehold;
BufferClass _changedInWizard;
WIZEditHousehold(ref BufferClass bufferFromUIHousehold)
{
_fromUIHousehold = bufferFromUIHousehold;
}
OnClose()
{
_fromUIHousehold = _changedInWizard;
}
}
OnClose, _fromUIHousehold values change in WIZEditHousehold, but these
values are NOT changed in UIHousehold's instance of BufferClass.
In summary, my problem is that I want to change the BUFFER POINTER, but
C# is treating _fromUIHousehold as a Pass By Value reference, not a
true reference (modifiable pointer).
I can accomplish this task via interfaces, upgrading BufferClass, or
events, but my proposed solution is much easier to code for the
multitudes of wizards and buffers I'm developing. Are there any ways
to allow me to treat _fromUIHousehold as a modifiable pointer to
UIHousehold's buffer?