更新 : 2007 年 11 月
名前空間 :
System.ServiceModel
アセンブリ :
System.ServiceModel (System.ServiceModel.dll 内)
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Method Or AttributeTargets.Interface, Inherited := False, _
AllowMultiple := False)> _
Public NotInheritable Class XmlSerializerFormatAttribute _
Inherits Attribute
Dim instance As XmlSerializerFormatAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Interface, Inherited = false,
AllowMultiple = false)]
public sealed class XmlSerializerFormatAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Method|AttributeTargets::Interface, Inherited = false,
AllowMultiple = false)]
public ref class XmlSerializerFormatAttribute sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Interface, Inherited = false, AllowMultiple = false) */
public final class XmlSerializerFormatAttribute extends Attribute
public final class XmlSerializerFormatAttribute extends Attribute
この属性は、DataContractFormatAttribute 属性に似ています。どちらの属性も、メソッド、クラス、またはインターフェイスに適用できます。
XmlSerializerの詳細については、「XmlSerializer クラスの使用」を参照してください。
メソッドには、2 つの属性のいずれかを適用でき、両方は適用できません。どちらの属性も適用されていない操作では、格納クラスに適用された属性を使用します。格納クラスにどちらの属性も適用されていない場合は、DataContractSerializer が使用されます。
属性を適用すると、実行時に XmlSerializerOperationBehavior が作成されます。この動作により、シリアライザの動作を実行時にカスタマイズできるようになります。
次の例では、XmlSerializerFormatAttribute をインターフェイスに適用します。
<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
[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);
}
System..::.Object
System..::.Attribute
System.ServiceModel..::.XmlSerializerFormatAttribute
この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
.NET Framework
サポート対象 : 3.5、3.0
参照
その他の技術情報