Прочетете на английски Редактиране

Споделяне чрез


XmlFormatExtensionPrefixAttribute Constructors

Definition

Initializes a new instance of the XmlFormatExtensionPrefixAttribute class.

Overloads

XmlFormatExtensionPrefixAttribute()

Initializes a new instance of the XmlFormatExtensionPrefixAttribute class.

XmlFormatExtensionPrefixAttribute(String, String)

Initializes a new instance of the XmlFormatExtensionPrefixAttribute class, setting the XML namespace and XML namespace prefix for a service description format extension.

XmlFormatExtensionPrefixAttribute()

Initializes a new instance of the XmlFormatExtensionPrefixAttribute class.

C#
public XmlFormatExtensionPrefixAttribute();

See also

Applies to

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

XmlFormatExtensionPrefixAttribute(String, String)

Initializes a new instance of the XmlFormatExtensionPrefixAttribute class, setting the XML namespace and XML namespace prefix for a service description format extension.

C#
public XmlFormatExtensionPrefixAttribute(string prefix, string ns);

Parameters

prefix
String

The XML namespace prefix associated with a service description format extension.

ns
String

The XML namespace associated with a service description format extension.

Examples

C#
// The YMLOperationBinding class is part of the YML SDFE, as it is the
// class that is serialized into XML and is placed in the service
// description.
[XmlFormatExtension("action", YMLOperationBinding.YMLNamespace,
    typeof(OperationBinding))]
[XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)]
public class YMLOperationBinding : ServiceDescriptionFormatExtension
{
    private Boolean reverse;

    public const string YMLNamespace = "http://www.contoso.com/yml";

    [XmlElement("Reverse")]
    public Boolean Reverse
    {
        get { return reverse; }
        set { reverse = value; }
    }
}

Applies to

.NET Framework 4.8.1 и други версии
Продукт Версии
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)