KGy SOFT

GenerateObjectSettings Class

KGy SOFT Core Libraries Help
Represents the settings for generating an object by the NextObject extension methods.
Inheritance Hierarchy

SystemObject
  KGySoft.CoreLibrariesGenerateObjectSettings

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.0.0-rc.1
Syntax

public sealed class GenerateObjectSettings

The GenerateObjectSettings type exposes the following members.

Constructors

  NameDescription
Public methodGenerateObjectSettings
Initializes a new instance of the GenerateObjectSettings class
Top
Properties

  NameDescription
Public propertyAllowCreateObjectWithoutConstructor
Gets or sets whether objects are allowed to be created without using the default constructor or (in case of collections) a constructor with a collection parameter.
Default value: .
Public propertyAllowDerivedTypesForNonSealedClasses
Gets or sets whether a random derived type is allowed to be picked for non-sealed classes.
Default value: .
Public propertyAllowNegativeValues
Gets or sets whether negative values are allowed when generating numbers.
Default value: .
Public propertyChanceOfNull
Gets or sets the chance of generating a  value when the type is compatible with .
Default value: 0.0.
Public propertyCloseDateTimes
Gets or sets whether close date and time values (current date plus-minus 100 years) should be produced when generating DateTime and DateTimeOffset values.
Default value: .
Public propertyCollectionsLength
Gets or sets the length of the collections to generate.
Default value: 1..2.
Public propertyFloatScale
Gets or sets the scale for generating floating point numbers.
Default value: Auto.
Public propertyMaxRecursionLevel
Gets or sets the maximum level of allowed recursion when generating objects, which contain members or elements of assignable types from their container types.
Default value: 1.
Public propertyObjectInitialization
Gets or sets the strategy for initializing a random generated object.
Default value: PublicFieldsAndPropeties.
Public propertyPastDateTimes
Gets or sets whether past date and time values should be produced when generating DateTime and DateTimeOffset instances.
Default value: .
Public propertySentencesLength
Gets or sets the length of the sentence strings to generate.
Default value: 30..60.
Public propertyStringCreation
Gets or sets the strategy for generating strings. Set  to auto select strategy by member name.
Default value: .
Public propertyStringsLength
Gets or sets the length of the non-sentence strings to generate.
Default value: 4..10.
Public propertySubstitutionForObjectType
Gets or sets the type to be used when a type of Object has to be generated.
Default value: .
Public propertyTryResolveInterfacesAndAbstractTypes
Gets or sets whether a random implementation should be picked for interfaces and abstract types.
Default value: .
Top
Methods

  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods

  NameDescription
Public Extension MethodConvert(Type, CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions.)
Public Extension MethodCode exampleConvertTTarget(CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions.)
Public Extension MethodIn (Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, CultureInfo, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(CultureInfo, TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Top
See Also

Reference