I have a class that has several properties, a couple which are string arrays. When the following statement:
MyObj.Str1[1] = "AAA";
MyObj.Str1[1]
does not contain "AAA". Using debug breakpoints, I see the set routine doesn't execute (the get routine does execute).
The property looks like:
public string[] Str1
{
get { return bdr.GetArrVal(1, 25, 7); }
set { bdr.SetArrVal(1, 25, 7, value); }
}
GetArrVal()
builds and returns a string array from class internal data. SetArrVal()
sets class internal data from the incoming array.
I tried using indexers but had too many problems passing class internal data into the class describing Str1
.
Please note that the statement
MyObj.Str1 = arr1;
works, where arr1
is a string array. The program breaks at the set routine.
All of this makes me think I cant do what I want. Can you assign a single element of a string-array property of an object?