Spring.Objects.Factory.Support.ObjectDefinitionBuilder.AddConstructorArg C# (CSharp) Method

AddConstructorArg() public method

Adds an index constructor arg value. The current index is tracked internally and all addtions are at the present point
public AddConstructorArg ( object value ) : ObjectDefinitionBuilder
value object The constructor arg value.
return ObjectDefinitionBuilder
        public ObjectDefinitionBuilder AddConstructorArg(object value)
        {
            objectDefinition.ConstructorArgumentValues.AddIndexedArgumentValue(constructorArgIndex++,value);
            return this;
        }

Usage Example

        /// <summary>
        /// Parse the supplied XmlElement and populate the supplied ObjectDefinitionBuilder as required.
        /// </summary>
        /// <param name="xml">The obejct representation in XML.</param>
        /// <param name="builder">The builder used to build the object definition in Spring.</param>
        protected override void DoParse(XmlElement xml, ObjectDefinitionBuilder builder)
        {
            // all behaviours with config being parsed have @respondsTo
            string respondsTo = xml.GetAttribute("responds-to");
            builder.AddConstructorArg(respondsTo);

            // all view behaviours have @content-type
            string contentType = xml.GetAttribute("content-type");
            builder.AddConstructorArg(contentType);
        }
All Usage Examples Of Spring.Objects.Factory.Support.ObjectDefinitionBuilder::AddConstructorArg