This documentation is archived and is not being maintained.

XmlFormatExtensionPrefixAttribute Constructor

.NET Framework 1.1

Initializes a new instance of the XmlFormatExtensionPrefixAttribute class.

Overload List

Initializes a new instance of the XmlFormatExtensionPrefixAttribute class.

[Visual Basic] Public Sub New()
[C#] public XmlFormatExtensionPrefixAttribute();
[C++] public: XmlFormatExtensionPrefixAttribute();
[JScript] public function XmlFormatExtensionPrefixAttribute();

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

[Visual Basic] Public Sub New(String, String)
[C#] public XmlFormatExtensionPrefixAttribute(string, string);
[C++] public: XmlFormatExtensionPrefixAttribute(String*, String*);
[JScript] public function XmlFormatExtensionPrefixAttribute(String, String);

Example

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of the XmlFormatExtensionPrefixAttribute constructor. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
' 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, _
    GetType(OperationBinding)), _
    XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)> _
Public Class YMLOperationBinding
    Inherits ServiceDescriptionFormatExtension
    Private _reverse As Boolean
    Public Const YMLNamespace As String = "http://www.contoso.com/yml"

    <XmlElement("Reverse")> _
    Public Property Reverse() As Boolean
        Get
            Return _reverse
        End Get
        Set(ByVal Value As Boolean)
            _reverse = Value
        End Set
    End Property

End Class

[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; }
    }
}

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

public:
    const String* YMLNamespace;
    YMLOperationBinding() : YMLNamespace(S"http://www.contoso.com/yml") {}

    [XmlElement(S"Reverse")]
    __property Boolean get_Reverse() { return reverse; }
    [XmlElement(S"Reverse")]
    __property void set_Reverse(Boolean value) { reverse = value; }
};

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

XmlFormatExtensionPrefixAttribute Class | XmlFormatExtensionPrefixAttribute Members | System.Web.Services.Configuration Namespace

Show: