BACnet.SchemaCompiler.CodeGen.CSharpTypeGenerator._getChoiceOptionForwardedParameters C# (CSharp) Method

_getChoiceOptionForwardedParameters() private method

Gets the parameters that need to be forwarded to a choice option's constructor
private _getChoiceOptionForwardedParameters ( FieldDefinition field ) : Parameter[]
field BACnet.SchemaParser.FieldDefinition The choice field
return Parameter[]
        private Parameter[] _getChoiceOptionForwardedParameters(FieldDefinition field)
        {
            if(_choiceOptionNeedsWrapper(field))
            {
                var wrappedTypeName = _getDefinitionName(null, field.Name, field.Type);
                var tempName = _fieldNameToTempName(field.Name);

                return new Parameter[] {
                    new Parameter(wrappedTypeName, tempName)
                };
            }
            else
            {
                var seq = (SequenceDefinition)field.Type;
                List<Parameter> ps = new List<Parameter>();

                foreach(var f in seq.Fields)
                {
                    var typeName = _getDefinitionName(null, f.Name, f.Type);
                    var tempName = _fieldNameToTempName(f.Name);
                    ps.Add(new Parameter(typeName, tempName));
                }

                return ps.ToArray();
            }
        }