[This is preliminary documentation and is subject to change.]
Sets a random value into the object property associated with this
Property.
Declaration Syntax
C# |
public void SetRandomValue( Persistent obj, Random random, int index, bool includeMemberName )
Parameters
- obj (Persistent)
- The object whose property is to be set.
- random (Random)
- a Random used for generating the value.
- index (Int32)
- The index of the object in its collection, or -1 if the object is not in a collection
- includeMemberName (Boolean)
- If true, the display name of text properties is included at the end of the property.
Remarks
This method is used by Persistent.WriteTestData as part of
the scheme to create a set of test objects for an application. For
numerical and DateTime properties, it seta a random value between the
defined bounds of the property if there are any, otherwise between the data
type's minimum and maximum values. For text properties it sets a value
comprising two 3 letter sequences followed by the index if supplied
followed by the property's FriendlyName if requested.