SetType() public method

Sets the type of the attribute definition.
public SetType ( string type ) : void
type string The string representation of the attribute type, corresponding to the values in the enumeration.
return void
Ejemplo n.º 1
0
        private void ParseAttType(char ch, AttDef attdef)
        {
            if (ch == '%')
            {
                Entity e = this.ParseParameterEntity(WhiteSpace);
                this.PushEntity(this.m_current.ResolvedUri, e);
                this.ParseAttType(this.m_current.Lastchar, attdef);
                this.PopEntity(); // bugbug - are we at the end of the entity?
                ch = this.m_current.Lastchar;
                return;
            }

            if (ch == '(')
            {
                //attdef.EnumValues = ParseNameGroup(ch, false);
                //attdef.Type = AttributeType.ENUMERATION;
                attdef.SetEnumeratedType(this.ParseNameGroup(ch, false), AttributeType.ENUMERATION);
            }
            else
            {
                string token = this.ScanName(WhiteSpace);
                if (string.Equals(token, "NOTATION", StringComparison.OrdinalIgnoreCase))
                {
                    ch = this.m_current.SkipWhitespace();
                    if (ch != '(')
                    {
                        this.m_current.Error("Expecting name group '(', but found '{0}'", ch);
                    }
                    //attdef.Type = AttributeType.NOTATION;
                    //attdef.EnumValues = ParseNameGroup(ch, true);
                    attdef.SetEnumeratedType(this.ParseNameGroup(ch, true), AttributeType.NOTATION);
                }
                else
                {
                    attdef.SetType(token);
                }
            }
        }