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

_sequenceFieldNeedsTypeSuffix() private method

Determines whether a sequence field type name needs -type appended to it so it won't conflict with a property name
private _sequenceFieldNeedsTypeSuffix ( FieldDefinition field ) : bool
field BACnet.SchemaParser.FieldDefinition The sequence field
return bool
        private bool _sequenceFieldNeedsTypeSuffix(FieldDefinition field)
        {
            var type = field.Type;
            if (type.Type == DefinitionType.Option)
                type = ((OptionDefinition)type).ElementType;
            if (type.Type == DefinitionType.Array)
                type = ((ArrayDefinition)type).ElementType;

            switch (type.Type)
            {
                case DefinitionType.Enumeration:
                case DefinitionType.BitString:
                case DefinitionType.Sequence:
                case DefinitionType.Choice:
                    return true;
            }

            return false;
        }