XmlSerializerFormatAttribute クラス
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
XmlObjectSerializer の代わりに XmlSerializer を使用するように Windows Communication Foundation (WCF) インフラストラクチャに指示します。
public ref class XmlSerializerFormatAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed class XmlSerializerFormatAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Method, Inherited=false)]
public sealed class XmlSerializerFormatAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)>]
type XmlSerializerFormatAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Method, Inherited=false)>]
type XmlSerializerFormatAttribute = class
inherit Attribute
Public NotInheritable Class XmlSerializerFormatAttribute
Inherits Attribute
- 継承
- 属性
次の例では、XmlSerializerFormatAttribute をインターフェイスに適用します。
[ServiceContract, XmlSerializerFormat(Style = OperationFormatStyle.Rpc,
Use = OperationFormatUse.Encoded)]
public interface ICalculator
{
[OperationContract, XmlSerializerFormat(Style = OperationFormatStyle.Rpc,
Use = OperationFormatUse.Encoded)]
double Add(double a, double b);
}
<ServiceContract(), XmlSerializerFormat(Style := OperationFormatStyle.Rpc, _
Use := OperationFormatUse.Encoded)> _
Public Interface ICalculator
<OperationContract(), XmlSerializerFormat(Style := OperationFormatStyle.Rpc, _
Use := OperationFormatUse.Encoded)> _
Function Add(ByVal a As Double, ByVal b As Double) As Double
End Interface
この属性は、DataContractFormatAttribute 属性に似ています。 どちらの属性も、メソッド、クラス、またはインターフェイスに適用できます。
詳細については XmlSerializer、「 XmlSerializer クラスの使用」を参照してください。
メソッドには、2 つの属性のいずれかを適用でき、両方は適用できません。 どちらの属性も適用されていない操作では、格納クラスに適用された属性を使用します。 格納クラスにどちらの属性も適用されていない場合は、DataContractSerializer が使用されます。
属性を適用すると、実行時に XmlSerializerOperationBehavior が作成されます。 この動作により、シリアライザーの動作を実行時にカスタマイズできるようになります。
Xml |
XmlSerializerFormatAttribute クラスの新しいインスタンスを初期化します。 |
Style |
XmlSerializer の SOAP スタイルを取得または設定します。 |
Support |
エラーの読み書きに XmlSerializer を使用する必要があることを示す値を取得または設定します。 |
Type |
派生クラスで実装されると、この Attribute の一意の識別子を取得します。 (継承元 Attribute) |
Use |
使用する形式を指定する値を取得または設定します。 |
Equals(Object) |
このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。 (継承元 Attribute) |
Get |
このインスタンスのハッシュ コードを返します。 (継承元 Attribute) |
Get |
現在のインスタンスの Type を取得します。 (継承元 Object) |
Is |
派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。 (継承元 Attribute) |
Match(Object) |
派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (継承元 Attribute) |
Memberwise |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
To |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
_Attribute. |
一連の名前を対応する一連のディスパッチ識別子に割り当てます。 (継承元 Attribute) |
_Attribute. |
オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。 (継承元 Attribute) |
_Attribute. |
オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。 (継承元 Attribute) |
_Attribute. |
オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。 (継承元 Attribute) |
製品 | バージョン |
---|---|
.NET | Core 1.0, Core 1.1 |
.NET Framework | 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 |
UWP | 10.0 |