RemoveTypeModifier() static private method

static private RemoveTypeModifier ( string &type, TypeModifier &typeModifier, bool &isRefType ) : void
type string
typeModifier TypeModifier
isRefType bool
return void
Beispiel #1
0
        private void HandleTypeAttribute(XmlReader reader)
        {
            string type;

            if (!Utils.GetString(this.Schema, reader, out type))
            {
                return;
            }
            TypeModifier typeModifier;

            Function.RemoveTypeModifier(ref type, out typeModifier, out this._isRefType);
            if (typeModifier == TypeModifier.Array)
            {
                this._collectionKind = CollectionKind.Bag;
            }
            if (!Utils.ValidateDottedName(this.Schema, reader, type))
            {
                return;
            }
            this.UnresolvedType = type;
        }
Beispiel #2
0
        private void HandleTypeAttribute(XmlReader reader)
        {
            DebugCheck.NotNull(reader);
            Debug.Assert(UnresolvedType == null);

            string type;

            if (!Utils.GetString(Schema, reader, out type))
            {
                return;
            }

            TypeModifier typeModifier;

            Function.RemoveTypeModifier(ref type, out typeModifier, out _isRefType);

            switch (typeModifier)
            {
            case TypeModifier.Array:
                CollectionKind = CollectionKind.Bag;
                break;

            default:
                Debug.Assert(
                    typeModifier == TypeModifier.None,
                    string.Format(
                        CultureInfo.CurrentCulture,
                        "Type is not valid for property {0}: {1}. The modifier for the type cannot be used in this context.", FQName,
                        reader.Value));
                break;
            }

            if (!Utils.ValidateDottedName(Schema, reader, type))
            {
                return;
            }

            UnresolvedType = type;
        }
Beispiel #3
0
        protected virtual void HandleReturnTypeAttribute(XmlReader reader)
        {
            string type;

            if (!Utils.GetString(this.Schema, reader, out type))
            {
                return;
            }
            TypeModifier typeModifier;

            Function.RemoveTypeModifier(ref type, out typeModifier, out this._isRefType);
            switch (typeModifier)
            {
            case TypeModifier.Array:
                this.CollectionKind = CollectionKind.Bag;
                break;
            }
            if (!Utils.ValidateDottedName(this.Schema, reader, type))
            {
                return;
            }
            this.UnresolvedReturnType = type;
        }