Object Properties

  • Thread starter Thread starter Tom Bean
  • Start date Start date
T

Tom Bean

Can someone confirm if member object variable are set directly they are
stored as copys of the object but if they are set using a property they are
stored as references?

For example, in the code below:

Does the statement "textBox1 = textBox0;" make a copy of textBox0 and assign
it to textBox0?

Does the statement "TextBoxProperty = textBox0" store a reference to
textBox0 in textBox1?

public class MyClass
{
public TextBox textBox1;
...
public TextBox TextBoxProperty
{
set
{
textBox1 = value;
}
}
}
 
Jon,

So, no matter how the member object variable is assigned it is always stored
as a reference?

Tom
 
Back
Top