XmlSchemaType.GetBuiltInSimpleType 메서드

정의

지정된 단순 형식의 기본 제공 단순 형식을 나타내는 XmlSchemaSimpleType을 반환합니다.

오버로드

GetBuiltInSimpleType(XmlTypeCode)

지정된 단순 형식의 기본 제공 단순 형식을 나타내는 XmlSchemaSimpleType을 반환합니다.

GetBuiltInSimpleType(XmlQualifiedName)

정규화된 이름으로 지정된 단순 형식의 기본 제공 단순 형식을 나타내는 XmlSchemaSimpleType을 반환합니다.

GetBuiltInSimpleType(XmlTypeCode)

지정된 단순 형식의 기본 제공 단순 형식을 나타내는 XmlSchemaSimpleType을 반환합니다.

public:
 static System::Xml::Schema::XmlSchemaSimpleType ^ GetBuiltInSimpleType(System::Xml::Schema::XmlTypeCode typeCode);
public static System.Xml.Schema.XmlSchemaSimpleType GetBuiltInSimpleType (System.Xml.Schema.XmlTypeCode typeCode);
static member GetBuiltInSimpleType : System.Xml.Schema.XmlTypeCode -> System.Xml.Schema.XmlSchemaSimpleType
Public Shared Function GetBuiltInSimpleType (typeCode As XmlTypeCode) As XmlSchemaSimpleType

매개 변수

typeCode
XmlTypeCode

단순 형식을 나타내는 XmlTypeCode 값 중 하나입니다.

반환

XmlSchemaSimpleType

기본 제공 단순 형식을 나타내는 XmlSchemaSimpleType입니다.

예제

다음 예제에서는 형식을 만들고 스키마에 추가하는 방법을 보여줍니다.

using System;
using System.Xml;
using System.Xml.Schema;

namespace GetBuiltInSimpleType
{
    class Program
    {
        static void Main(string[] args)
        {
            XmlSchema schema = new XmlSchema();
            XmlSchemaSimpleType stringType = new XmlSchemaSimpleType();
            stringType.Name = "myString";
            schema.Items.Add(stringType);
            XmlSchemaSimpleTypeRestriction stringRestriction =
                                 new XmlSchemaSimpleTypeRestriction();
            stringRestriction.BaseTypeName =
                                 new XmlQualifiedName("string",
                         "http://www.w3.org/2001/XMLSchema");
            stringType.Content = stringRestriction;
            schema.Write(Console.Out);
        }
    }
}
Imports System.Xml
Imports System.Xml.Schema

Module Module1

    Sub Main()

        Dim schema As XmlSchema = New XmlSchema()
        Dim stringType As XmlSchemaSimpleType = New XmlSchemaSimpleType()
        stringType.Name = "myString"
        schema.Items.Add(stringType)
        Dim stringRestriction As XmlSchemaSimpleTypeRestriction = _
                                 New XmlSchemaSimpleTypeRestriction()
        stringRestriction.BaseTypeName = _
                                 New XmlQualifiedName("string", _
                                 "http://www.w3.org/2001/XMLSchema")
        stringType.Content = stringRestriction
        schema.Write(Console.Out)

    End Sub

End Module

설명

기본 제공 형식을 직접 직렬화할 수는 없습니다. 형식을 직렬화해야 하는 경우 기본 제공 형식에서 파생되는 새 단순 형식을 만들고 단순 형식을 직렬화합니다.

적용 대상

GetBuiltInSimpleType(XmlQualifiedName)

정규화된 이름으로 지정된 단순 형식의 기본 제공 단순 형식을 나타내는 XmlSchemaSimpleType을 반환합니다.

public:
 static System::Xml::Schema::XmlSchemaSimpleType ^ GetBuiltInSimpleType(System::Xml::XmlQualifiedName ^ qualifiedName);
public static System.Xml.Schema.XmlSchemaSimpleType? GetBuiltInSimpleType (System.Xml.XmlQualifiedName qualifiedName);
public static System.Xml.Schema.XmlSchemaSimpleType GetBuiltInSimpleType (System.Xml.XmlQualifiedName qualifiedName);
static member GetBuiltInSimpleType : System.Xml.XmlQualifiedName -> System.Xml.Schema.XmlSchemaSimpleType
Public Shared Function GetBuiltInSimpleType (qualifiedName As XmlQualifiedName) As XmlSchemaSimpleType

매개 변수

qualifiedName
XmlQualifiedName

단순 형식의 XmlQualifiedName입니다.

반환

XmlSchemaSimpleType

기본 제공 단순 형식을 나타내는 XmlSchemaSimpleType입니다.

예외

XmlQualifiedName 매개 변수가 null인 경우

예제

다음 예제에서는 형식을 만들고 스키마에 추가하는 방법을 보여줍니다.

using System;
using System.Xml;
using System.Xml.Schema;

namespace GetBuiltInSimpleType
{
    class Program
    {
        static void Main(string[] args)
        {
            XmlSchema schema = new XmlSchema();
            XmlSchemaSimpleType stringType = new XmlSchemaSimpleType();
            stringType.Name = "myString";
            schema.Items.Add(stringType);
            XmlSchemaSimpleTypeRestriction stringRestriction =
                                 new XmlSchemaSimpleTypeRestriction();
            stringRestriction.BaseTypeName =
                                 new XmlQualifiedName("string",
                         "http://www.w3.org/2001/XMLSchema");
            stringType.Content = stringRestriction;
            schema.Write(Console.Out);
        }
    }
}
Imports System.Xml
Imports System.Xml.Schema

Module Module1

    Sub Main()

        Dim schema As XmlSchema = New XmlSchema()
        Dim stringType As XmlSchemaSimpleType = New XmlSchemaSimpleType()
        stringType.Name = "myString"
        schema.Items.Add(stringType)
        Dim stringRestriction As XmlSchemaSimpleTypeRestriction = _
                                 New XmlSchemaSimpleTypeRestriction()
        stringRestriction.BaseTypeName = _
                                 New XmlQualifiedName("string", _
                                 "http://www.w3.org/2001/XMLSchema")
        stringType.Content = stringRestriction
        schema.Write(Console.Out)

    End Sub

End Module

설명

기본 제공 형식을 직접 직렬화할 수는 없습니다. 형식을 직렬화해야 하는 경우 기본 제공 형식에서 파생되는 새 단순 형식을 만들고 단순 형식을 직렬화합니다.

적용 대상