XmlChoiceIdentifierAttributeとは? わかりやすく解説

XmlChoiceIdentifierAttribute クラス

列挙体を使用してメンバ明確に検出できるようにすることを指定します

名前空間: System.Xml.Serialization
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Field
 Or AttributeTargets.Parameter Or AttributeTargets.ReturnValue,
 AllowMultiple:=False)> _
Public Class XmlChoiceIdentifierAttribute
    Inherits Attribute
Dim instance As XmlChoiceIdentifierAttribute
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter|AttributeTargets.ReturnValue,
 AllowMultiple=false)] 
public class XmlChoiceIdentifierAttribute :
 Attribute
[AttributeUsageAttribute(AttributeTargets::Property|AttributeTargets::Field|AttributeTargets::Parameter|AttributeTargets::ReturnValue,
 AllowMultiple=false)] 
public ref class XmlChoiceIdentifierAttribute
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter|AttributeTargets.ReturnValue,
 AllowMultiple=false) */ 
public class XmlChoiceIdentifierAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter|AttributeTargets.ReturnValue,
 AllowMultiple=false) 
public class XmlChoiceIdentifierAttribute extends
 Attribute
解説解説

xsi:choice という名前の XML スキーマ要素定義を使用すると、その子のうちの 1 つだけインスタンス含めることのできる (maxoccurs = 1) 複合要素を定義できますインスタンス含めることのできる子は、いくつかの型のいずれかになり、その名前もいくつかの名前のうちの 1 つなりますそれぞれの名前は特定の型に関連付けられますが、いくつかの名前を同じ型に関連付けることもできます。したがってこのような要素インスタンスあいまいになりますこのようなあいまいな要素の例として、MyChoice という名前の要素定義するスキーマ フラグメント次に示します

 <xsd:complexType name="MyChoice">
  <xsd:sequence>
  <xsd:choice minOccurs="0" maxOccurs="1">
  <xsd:element minOccurs="1" maxOccurs="1" name="ChoiceOne" type="xsd:string"
 />
  <xsd:element minOccurs="1" maxOccurs="1" name="ChoiceTwo" type="xsd:string"
 />
  </xsd:choice>
  </xsd:sequence>
 </xsd:complexType>

XmlChoiceIdentifierAttribute使用すると、メンバの各インスタンス特定の列挙値を割り当てることができます列挙体は独自に作成するか、XML スキーマ定義ツール (Xsd.exe) を使用して作成する必要があります次の C# コードでは、XmlChoiceIdentifierAttributeItem フィールド適用する方法示してます。その MemberName プロパティには、メンバインスタンス検出するために使用する列挙体を格納しているフィールド指定されています。

 public class Choices{
  [XmlChoiceIdentifier("ItemType")]
  [XmlChoiceIdentifier("ChoiceOne")]
  [XmlChoiceIdentifier("ChoiceTwo")]
  public string MyChoice;

  // Do not serialize this next field:
  [XmlIgnore]
  public ItemChoiceType ItemType;
 }
 // Do not include this enumeration in the XML schema.
 [XmlType(IncludeInSchema = false)]
 public enum ItemChoiceType{
  ChoiceOne,
  ChoiceTwo,
 }

このコード正しい場所に記述すると、ItemType フィールド適切な列挙体を設定することによって、このクラスシリアル化および逆シリアル化できます。たとえば、Choice クラスシリアル化するための C# コードは、次のようになります

 Choices mc = new Choices();
 mc.MyChoice = "Item Choice One";
 mc.ItemType = ItemChoiceType.ChoiceOne;

シリアル化する場合C# コード次のようになります

 MyChoice mc = (MyChoice) myXmlSerializer.Deserialize(myReader);
 if(mc.ItemType == ItemChoiceType.ChoiceOne)
  {
      // Handle choice one.
  }
 if(mc.ItemType == ItemChoiceType.ChoiceTwo)
  {
      // Handle choice two.
  }
 if(mc.ItemType != null)
  {
      throw CreateUnknownTypeException(mc.Item);
  }

XmlChoiceIdentifierAttribute用途は、もう 1 つあります次のスキーマでは、メンバは、項目の配列 (maxOccurs="unbounded") を返すフィールドです。この配列には、最初要素 ("D-a-t-a") と 2 番目の要素 ("MoreData") のオブジェクト格納できます

 <xsd:complexType name="MyChoice">
  <xsd:sequence>
  <xsd:choice minOccurs="0" maxOccurs="unbounded">
  <xsd:element minOccurs="1" maxOccurs="1" name="D-a-t-a" type="xsd:string" />
  <xsd:element minOccurs="1" maxOccurs="1" name="MoreData" type="xsd:string" />
  </xsd:choice>
  </xsd:sequence>
 </xsd:complexType>

結果として生成されクラスは、このフィールド使用して項目の配列返します配列の各項目について、ItemChoiceType 列挙体の値が対応している必要があります。この対応している列挙値が、ItemsElementName フィールドによって返される配列格納されています。

 public class MyChoice {
  [System.Xml.Serialization.XmlElementAttribute("D-a-t-a", typeof(string), IsNullable=false)]
  [System.Xml.Serialization.XmlElementAttribute("MoreData", typeof(string), IsNullable=false)]
  [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
  public string[] Items;
  [System.Xml.Serialization.XmlElementAttribute(IsNullable=false)]
  [System.Xml.Serialization.XmlIgnoreAttribute()]
  public ItemsChoiceType[] ItemsElementName;
 }
 [System.Xml.Serialization.XmlTypeAttribute(IncludeInSchema=false)]
 public enum ItemsChoiceType {
  [System.Xml.Serialization.XmlEnumAttribute("D-a-t-a")]
  Data,
  MoreData,
 }

一定範囲内複数choice 要素含んでいるオブジェクトを逆シリアル化するときは、制御構造 (if...then...else 構造など) を使用して特定の値を逆シリアル化する方法決定します。この制御構造では、列挙値を調べその結果基づいて値を逆シリアル化ます。

使用例使用例

MyChoiceManyChoices という 2 つフィールド含んでいる Choices という名前のクラスシリアル化する例を次に示します。各フィールドXmlChoiceIdentifierAttribute適用されており、これらのフィールドは、MemberName プロパティ使用してそれぞれのメンバの値を検出するための列挙体を取得または設定する別のクラス メンバ指定してます。MyChoice フィールドには、対応する列挙メンバEnumType フィールド内に存在している単一の値を設定できますManyChoices フィールドは、オブジェクト配列返しますChoiceArray フィールドは、列挙値の配列返しますManyChoices フィールドの各配列メンバ対応するメンバが、ChoiceArray フィールドによって返される配列中につかります

Imports System
Imports System.Xml
Imports System.Xml.Serialization
Imports System.IO

Public Class Choices
   ' The MyChoice field can be set to any one of 
   ' the types below. 
   <XmlChoiceIdentifier("EnumType"), _
   XmlElement("Word", GetType(String)),
 _
   XmlElement("Number", GetType(Integer)),
 _
   XmlElement("DecimalNumber", GetType(double))>
 _
   Public MyChoice As Object
 

   ' Don't serialize this field. The EnumType field
   ' contains the enumeration value that corresponds
   ' to the MyChoice field value.
   <XmlIgnore> _
   Public EnumType As ItemChoiceType 

   'The ManyChoices field can contain an array
   ' of choices. Each choice must be matched to
   ' an array item in the ChoiceArray field.
   <XmlChoiceIdentifier("ChoiceArray"), _
   XmlElement("Item", GetType(string)),
 _
   XmlElement("Amount", GetType(Integer)),
 _
   XmlElement("Temp", GetType(double))>
 _
   Public ManyChoices() As Object

   ' TheChoiceArray field contains the enumeration
   ' values, one for each item in the ManyChoices array.
   <XmlIgnore> _
   Public ChoiceArray() As MoreChoices
End Class

<XmlType(IncludeInSchema:=false)> _
Public Enum ItemChoiceType
   None
   Word 
   Number
   DecimalNumber
End Enum

<XmlType(IncludeInSchema:=false)> _
Public Enum MoreChoices
   None
   Item
   Amount
   Temp
End Enum

Public Class Test
   Shared Sub Main()
      Dim t  As Test = New
 Test()
      t.SerializeObject("Choices.xml")
      t.DeserializeObject("Choices.xml")
   End Sub

   private Sub SerializeObject(filename As
 string)
      Dim mySerializer As XmlSerializer = _
      New XmlSerializer(GetType(Choices))
      Dim writer As TextWriter = New
 StreamWriter(filename)
      Dim myChoices As Choices = New
 Choices()

      ' Set the MyChoice field to a string. Set the
      ' EnumType to Word.
      myChoices.MyChoice= "Book"
      myChoices.EnumType = ItemChoiceType.Word

      ' Populate an object array with three items, one
      ' of each enumeration type. Set the array to the 
      ' ManyChoices field.
      Dim strChoices () As Object
 = New object(){"Food",
  5, 98.6}
      myChoices.ManyChoices=strChoices

      ' For each item in the ManyChoices array, add an
      ' enumeration value.
      Dim itmChoices () As MoreChoices = New
 MoreChoices() _
      {MoreChoices.Item, _
      MoreChoices.Amount, _
      MoreChoices.Temp}
      myChoices.ChoiceArray=itmChoices
      
      mySerializer.Serialize(writer, myChoices)
      writer.Close()
   End Sub

   private Sub DeserializeObject(filename As
 string)
      Dim ser As XmlSerializer = New
 XmlSerializer(GetType(Choices))
      

      ' A FileStream is needed to read the XML document.
      Dim fs As FileStream = New
 FileStream(filename, FileMode.Open)
      
      Dim myChoices As Choices = CType(ser.Deserialize(fs),
 Choices)

      fs.Close()

      ' Disambiguate the MyChoice value Imports the enumeration.
      if myChoices.EnumType = ItemChoiceType.Word Then
             Console.WriteLine("Word: " & _
             myChoices.MyChoice.ToString())
          
      else if myChoices.EnumType = ItemChoiceType.Number
 Then 
             Console.WriteLine("Number: " & _
                 myChoices.MyChoice.ToString())
          
      else if myChoices.EnumType = ItemChoiceType.DecimalNumber
 Then
         Console.WriteLine("DecimalNumber: " &
 _
                 myChoices.MyChoice.ToString())
          End If

      ' Disambiguate the ManyChoices values Imports the enumerations.
      Dim i As Integer
      for i = 0 to myChoices.ManyChoices.Length
 -1
      if myChoices.ChoiceArray(i) = MoreChoices.Item Then
          Console.WriteLine("Item: " +  _
          myChoices.ManyChoices(i).ToString())
      else if myChoices.ChoiceArray(i) = MoreChoices.Amount
 Then
          Console.WriteLine("Amount: " + _
          myChoices.ManyChoices(i).ToString())
      else if (myChoices.ChoiceArray(i) = MoreChoices.Temp)
          Console.WriteLine("Temp: " + _
          myChoices.ManyChoices(i).ToString())
          End If
          Next i
      
   End Sub
End Class
using System;
using System.Xml;
using System.Xml.Serialization;
using System.IO;

public class Choices{
   // The MyChoice field can be set to any one of 
   // the types below. 
   [XmlChoiceIdentifier("EnumType")]
   [XmlElement("Word", typeof(string))]
   [XmlElement("Number", typeof(int))]
   [XmlElement("DecimalNumber", typeof(double))]
   public object MyChoice;

   // Don't serialize this field. The EnumType field
   // contains the enumeration value that corresponds
   // to the MyChoice field value.
   [XmlIgnore]
   public ItemChoiceType EnumType;

   // The ManyChoices field can contain an array
   // of choices. Each choice must be matched to
   // an array item in the ChoiceArray field.
   [XmlChoiceIdentifier("ChoiceArray")]
   [XmlElement("Item", typeof(string))]
   [XmlElement("Amount", typeof(int))]
   [XmlElement("Temp", typeof(double))]
   public object[] ManyChoices;

   // TheChoiceArray field contains the enumeration
   // values, one for each item in the ManyChoices array.
   [XmlIgnore]
   public MoreChoices[] ChoiceArray;
}

[XmlType(IncludeInSchema=false)]
public enum ItemChoiceType{
   None,
   Word, 
   Number,
   DecimalNumber
}

public enum MoreChoices{
   None,
   Item,
   Amount,
   Temp
}

public class Test{
   static void Main(){
      Test t = new Test();
      t.SerializeObject("Choices.xml");
      t.DeserializeObject("Choices.xml");
   }

   private void SerializeObject(string
 filename){
      XmlSerializer mySerializer = 
      new XmlSerializer(typeof(Choices));
      TextWriter writer = new StreamWriter(filename);
      Choices myChoices = new Choices();

      // Set the MyChoice field to a string. Set the
      // EnumType to Word.
      myChoices.MyChoice= "Book";
      myChoices.EnumType = ItemChoiceType.Word;

      // Populate an object array with three items, one
      // of each enumeration type. Set the array to the 
      // ManyChoices field.
      object[] strChoices = new object[]{"Food",  5,
 98.6};
      myChoices.ManyChoices=strChoices;

      // For each item in the ManyChoices array, add an
      // enumeration value.
      MoreChoices[] itmChoices = new MoreChoices[]
      {MoreChoices.Item, 
      MoreChoices.Amount,
      MoreChoices.Temp};
      myChoices.ChoiceArray=itmChoices;
      
      mySerializer.Serialize(writer, myChoices);
      writer.Close();
   }

   private void DeserializeObject(string
 filename){
      XmlSerializer ser = new XmlSerializer(typeof(Choices));

      // A FileStream is needed to read the XML document.
      FileStream fs = new FileStream(filename, FileMode.Open);
      Choices myChoices = (Choices)
      ser.Deserialize(fs);
      fs.Close();

      // Disambiguate the MyChoice value using the enumeration.
      if(myChoices.EnumType == ItemChoiceType.Word){
             Console.WriteLine("Word: " +  
                 myChoices.MyChoice.ToString());
          }
      else if(myChoices.EnumType == ItemChoiceType.Number){
             Console.WriteLine("Number: " +
                 myChoices.MyChoice.ToString());
          }
      else if(myChoices.EnumType == ItemChoiceType.DecimalNumber){
             Console.WriteLine("DecimalNumber: " +
                 myChoices.MyChoice.ToString());
          }

      // Disambiguate the ManyChoices values using the enumerations.
      for(int i = 0; i<myChoices.ManyChoices.Length;
 i++){
      if(myChoices.ChoiceArray[i] == MoreChoices.Item)
          Console.WriteLine("Item: " + (string) myChoices.ManyChoices[i]);
      else if(myChoices.ChoiceArray[i] == MoreChoices.Amount)
          Console.WriteLine("Amount: " + myChoices.ManyChoices[i].ToString());
      if(myChoices.ChoiceArray[i] == MoreChoices.Temp)
          Console.WriteLine("Temp: " + (string) myChoices.ManyChoices[i].ToString());
          }
      
   }
}
#using <System.dll>
#using <System.xml.dll>

using namespace System;
using namespace System::Xml;
using namespace System::Xml::Serialization;
using namespace System::IO;

[XmlType(IncludeInSchema=false)]

public enum class ItemChoiceType
{
   None, Word, Number, DecimalNumber
};

public enum class MoreChoices
{
   None, Item, Amount, Temp
};

public ref class Choices
{
public:

   // The MyChoice field can be set to any one of 
   // the types below. 

   [XmlChoiceIdentifier("EnumType")]
   [XmlElement("Word",String::typeid)]
   [XmlElement("Number",Int32::typeid)]
   [XmlElement("DecimalNumber",Double::typeid)]
   Object^ MyChoice;

   // Don't serialize this field. The EnumType field
   // contains the enumeration value that corresponds
   // to the MyChoice field value.

   [XmlIgnore]
   ItemChoiceType EnumType;

   // The ManyChoices field can contain an array
   // of choices. Each choice must be matched to
   // an array item in the ChoiceArray field.

   [XmlChoiceIdentifier("ChoiceArray")]
   [XmlElement("Item",String::typeid)]
   [XmlElement("Amount",Int32::typeid)]
   [XmlElement("Temp",Double::typeid)]
   array<Object^>^ManyChoices;

   // TheChoiceArray field contains the enumeration
   // values, one for each item in the ManyChoices array.

   [XmlIgnore]
   array<MoreChoices>^ChoiceArray;
};

void SerializeObject( String^ filename );
void DeserializeObject( String^ filename );
int main()
{
   SerializeObject( "Choices.xml" );
   DeserializeObject( "Choices.xml" );
}

void SerializeObject( String^ filename )
{
   XmlSerializer^ mySerializer = gcnew XmlSerializer( Choices::typeid );
   TextWriter^ writer = gcnew StreamWriter( filename );
   Choices^ myChoices = gcnew Choices;

   // Set the MyChoice field to a string. Set the
   // EnumType to Word.
   myChoices->MyChoice = "Book";
   myChoices->EnumType = ItemChoiceType::Word;

   // Populate an object array with three items, one
   // of each enumeration type. Set the array to the 
   // ManyChoices field.
   array<Object^>^strChoices = {"Food",5,98.6};
   myChoices->ManyChoices = strChoices;

   // For each item in the ManyChoices array, add an
   // enumeration value.
   array<MoreChoices>^ itmChoices = {MoreChoices::Item,MoreChoices::Amount
,MoreChoices::Temp};
   myChoices->ChoiceArray = itmChoices;
   mySerializer->Serialize( writer, myChoices );
   writer->Close();
}

void DeserializeObject( String^ filename )
{
   XmlSerializer^ ser = gcnew XmlSerializer( Choices::typeid );

   // A FileStream is needed to read the XML document.
   FileStream^ fs = gcnew FileStream( filename,FileMode::Open );
   Choices^ myChoices = safe_cast<Choices^>(ser->Deserialize( fs ));
   fs->Close();

   // Disambiguate the MyChoice value using the enumeration.
   if ( myChoices->EnumType == ItemChoiceType::Word )
   {
      Console::WriteLine( "Word: {0}", myChoices->MyChoice->ToString()
 );
   }
   else
   if ( myChoices->EnumType == ItemChoiceType::Number )
   {
      Console::WriteLine( "Number: {0}", myChoices->MyChoice->ToString()
 );
   }
   else
   if ( myChoices->EnumType == ItemChoiceType::DecimalNumber
 )
   {
      Console::WriteLine( "DecimalNumber: {0}", myChoices->MyChoice->ToString()
 );
   }

   // Disambiguate the ManyChoices values using the enumerations.
   for ( int i = 0; i < myChoices->ManyChoices->Length;
 i++ )
   {
      if ( myChoices->ChoiceArray[ i ] == MoreChoices::Item
 )
            Console::WriteLine( "Item: {0}", myChoices->ManyChoices[
 i ] );
      else
      if ( myChoices->ChoiceArray[ i ] == MoreChoices::Amount
 )
            Console::WriteLine( "Amount: ", myChoices->ManyChoices[
 i ]->ToString() );
      if ( myChoices->ChoiceArray[ i ] == MoreChoices::Temp
 )
            Console::WriteLine( "Temp: {0}", myChoices->ManyChoices[
 i ]->ToString() );
   }
}
import System.*;
import System.Xml.*;
import System.Xml.Serialization.*;
import System.IO.*;
public class Choices
{
    // The myChoice field can be set to any one of 
    // the types below. 
    /** @attribute XmlElement("word", String.class)
     */
    /** @attribute XmlElement("Number", int.class)
     */
    /** @attribute XmlElement("DecimalNumber", double.class)
     */
    public Object myChoice;

    // Don't serialize this field. The EnumType field
    // contains the enumeration value that corresponds
    // to the myChoice field value.
    public int enumType;

    // The manyChoices field can contain an array
    // of choices. Each choice must be matched to
    // an array item in the choiceArray field.
    /** @attribute XmlElement("Item", String.class)
     */
    /** @attribute XmlElement("amount", int.class)
     */
    /** @attribute XmlElement("temp", double.class)
     */
    public Object manyChoices[];

    // ThechoiceArray field contains the enumeration
    // values, one for each item in the manyChoices array.
    public int choiceArray[];
} //Choices

/** @attribute XmlType(IncludeInSchema = false)
 */
public class ItemChoiceType
{
    public static final int
 none = 0;
    public static final int
 word = 1;
    public static final int
 number = 2;
    public static final int
 decimalNumber = 3;
} //ItemChoiceType

public class MoreChoices
{
    public static final int
 none = 0;
    public static final int
 item = 1;
    public static final int
 amount = 2;
    public static final int
 temp = 3;
} //MoreChoices

public class Test
{
    public static void main(String[]
 args)
    {
        Test t = new Test();
        t.SerializeObject("Choices.xml");
        t.DeserializeObject("Choices.xml");
    } //main

    private void SerializeObject(String fileName)
    {
        XmlSerializer mySerializer = new XmlSerializer(Choices.class.ToType());
        TextWriter writer = new StreamWriter(fileName);
        Choices myChoices = new Choices();
        // Set the myChoice field to a string. Set the
        // enumType to word.
        myChoices.myChoice = "Book";
        myChoices.enumType = ItemChoiceType.word;
        // Populate an object array with three items, one
        // of each enumeration type. Set the array to the 
        // manyChoices field.
        Object strChoices[] = new Object[] { "Food",
 (Int32)5,
            (System.Double)98.6 };
        myChoices.manyChoices = strChoices;
        // For each item in the manyChoices array, add an
        // enumeration value.
        int itmChoices[] = new int[]
 {
            MoreChoices.item, MoreChoices.amount, MoreChoices.temp
        };

        myChoices.choiceArray = new int[itmChoices.get_Length()];
        itmChoices.CopyTo(myChoices.choiceArray, 0);

        //myChoices.choiceArray = itmChoices;
        mySerializer.Serialize(writer, myChoices);
        writer.Close();
    } //SerializeObject

    private void DeserializeObject(String fileName)
    {
        XmlSerializer ser = new XmlSerializer(Choices.class.ToType());
        // A FileStream is needed to read the XML document.
        FileStream fs = new FileStream(fileName, FileMode.Open);
        Choices myChoices = (Choices)ser.Deserialize(fs);
        fs.Close();
        // Disambiguate the myChoice value using the enumeration.
        if (myChoices.enumType == ItemChoiceType.word) {
            Console.WriteLine("Word: " + myChoices.myChoice.ToString());
        }
        else {
            if (myChoices.enumType == ItemChoiceType.number) {
                Console.WriteLine("Number: " + myChoices.myChoice.ToString());
            }
            else {
                if (myChoices.enumType == ItemChoiceType.decimalNumber)
 {
                    Console.WriteLine("DecimalNumber: " +
                        myChoices.myChoice.ToString());
                }
            }
        }
        // Disambiguate the manyChoices values using the enumerations.
        for (int i = 0; i < myChoices.manyChoices.get_Length();
 i++) {
            if (System.Convert.ToInt32(myChoices.choiceArray.get_Item(i))
 ==
                MoreChoices.item) {
                Console.WriteLine("Item: " 
                    + (String)(myChoices.manyChoices.get_Item(i)));
            }
            else {
                if (System.Convert.ToInt32(myChoices.choiceArray.
                    get_Item(i)) == MoreChoices.amount) {
                    Console.WriteLine("Amount: " +
                        myChoices.manyChoices.get_Item(i).ToString());
                }
            }
            if (System.Convert.ToInt32(myChoices.choiceArray.
                get_Item(i)) == MoreChoices.temp) {
                Console.WriteLine("Temp: " + (String)(
                    myChoices.manyChoices.get_Item(i).ToString()));
            }
        }
    } //DeserializeObject 
} //Test
継承階層継承階層
System.Object
   System.Attribute
    System.Xml.Serialization.XmlChoiceIdentifierAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

XmlChoiceIdentifierAttribute コンストラクタ ()

XmlChoiceIdentifierAttribute クラス新しインスタンス初期化します。

名前空間: System.Xml.Serialization
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

Dim instance As New XmlChoiceIdentifierAttribute
public XmlChoiceIdentifierAttribute ()
public:
XmlChoiceIdentifierAttribute ()
public XmlChoiceIdentifierAttribute ()
public function XmlChoiceIdentifierAttribute
 ()
使用例使用例

MyChoiceManyChoices という 2 つフィールド含んでいる Choices という名前のクラスシリアル化する例を次に示します。各フィールドXmlChoiceIdentifierAttribute適用されており、これらのフィールドは、MemberName プロパティ使用してそれぞれのメンバの値を検出するための列挙体を取得または設定する別のクラス メンバ指定してます。MyChoice フィールドには、対応する列挙メンバEnumType フィールド内に存在している単一の値を設定できますManyChoices フィールドは、オブジェクト配列返しますChoiceArray フィールドは、列挙値の配列返しますManyChoices フィールドの各配列メンバ対応するメンバが、ChoiceArray フィールドによって返される配列中につかります

Imports System
Imports System.Xml
Imports System.Xml.Serialization
Imports System.IO

Public Class Choices
   ' The MyChoice field can be set to any one of 
   ' the types below. 
   <XmlChoiceIdentifier("EnumType"), _
   XmlElement("Word", GetType(String)),
 _
   XmlElement("Number", GetType(Integer)),
 _
   XmlElement("DecimalNumber", GetType(double))>
 _
   Public MyChoice As Object
 

   ' Don't serialize this field. The EnumType field
   ' contains the enumeration value that corresponds
   ' to the MyChoice field value.
   <XmlIgnore> _
   Public EnumType As ItemChoiceType 

   'The ManyChoices field can contain an array
   ' of choices. Each choice must be matched to
   ' an array item in the ChoiceArray field.
   <XmlChoiceIdentifier("ChoiceArray"), _
   XmlElement("Item", GetType(string)),
 _
   XmlElement("Amount", GetType(Integer)),
 _
   XmlElement("Temp", GetType(double))>
 _
   Public ManyChoices() As Object

   ' TheChoiceArray field contains the enumeration
   ' values, one for each item in the ManyChoices array.
   <XmlIgnore> _
   Public ChoiceArray() As MoreChoices
End Class

<XmlType(IncludeInSchema:=false)> _
Public Enum ItemChoiceType
   None
   Word 
   Number
   DecimalNumber
End Enum

<XmlType(IncludeInSchema:=false)> _
Public Enum MoreChoices
   None
   Item
   Amount
   Temp
End Enum

Public Class Test
   Shared Sub Main()
      Dim t  As Test = New
 Test()
      t.SerializeObject("Choices.xml")
      t.DeserializeObject("Choices.xml")
   End Sub

   private Sub SerializeObject(filename As
 string)
      Dim mySerializer As XmlSerializer = _
      New XmlSerializer(GetType(Choices))
      Dim writer As TextWriter = New
 StreamWriter(filename)
      Dim myChoices As Choices = New
 Choices()

      ' Set the MyChoice field to a string. Set the
      ' EnumType to Word.
      myChoices.MyChoice= "Book"
      myChoices.EnumType = ItemChoiceType.Word

      ' Populate an object array with three items, one
      ' of each enumeration type. Set the array to the 
      ' ManyChoices field.
      Dim strChoices () As Object
 = New object(){"Food",
  5, 98.6}
      myChoices.ManyChoices=strChoices

      ' For each item in the ManyChoices array, add an
      ' enumeration value.
      Dim itmChoices () As MoreChoices = New
 MoreChoices() _
      {MoreChoices.Item, _
      MoreChoices.Amount, _
      MoreChoices.Temp}
      myChoices.ChoiceArray=itmChoices
      
      mySerializer.Serialize(writer, myChoices)
      writer.Close()
   End Sub

   private Sub DeserializeObject(filename As
 string)
      Dim ser As XmlSerializer = New
 XmlSerializer(GetType(Choices))
      

      ' A FileStream is needed to read the XML document.
      Dim fs As FileStream = New
 FileStream(filename, FileMode.Open)
      
      Dim myChoices As Choices = CType(ser.Deserialize(fs),
 Choices)

      fs.Close()

      ' Disambiguate the MyChoice value Imports the enumeration.
      if myChoices.EnumType = ItemChoiceType.Word Then
             Console.WriteLine("Word: " & _
             myChoices.MyChoice.ToString())
          
      else if myChoices.EnumType = ItemChoiceType.Number
 Then 
             Console.WriteLine("Number: " & _
                 myChoices.MyChoice.ToString())
          
      else if myChoices.EnumType = ItemChoiceType.DecimalNumber
 Then
         Console.WriteLine("DecimalNumber: " &
 _
                 myChoices.MyChoice.ToString())
          End If

      ' Disambiguate the ManyChoices values Imports the enumerations.
      Dim i As Integer
      for i = 0 to myChoices.ManyChoices.Length
 -1
      if myChoices.ChoiceArray(i) = MoreChoices.Item Then
          Console.WriteLine("Item: " +  _
          myChoices.ManyChoices(i).ToString())
      else if myChoices.ChoiceArray(i) = MoreChoices.Amount
 Then
          Console.WriteLine("Amount: " + _
          myChoices.ManyChoices(i).ToString())
      else if (myChoices.ChoiceArray(i) = MoreChoices.Temp)
          Console.WriteLine("Temp: " + _
          myChoices.ManyChoices(i).ToString())
          End If
          Next i
      
   End Sub
End Class
using System;
using System.Xml;
using System.Xml.Serialization;
using System.IO;

public class Choices{
   // The MyChoice field can be set to any one of 
   // the types below. 
   [XmlChoiceIdentifier("EnumType")]
   [XmlElement("Word", typeof(string))]
   [XmlElement("Number", typeof(int))]
   [XmlElement("DecimalNumber", typeof(double))]
   public object MyChoice;

   // Don't serialize this field. The EnumType field
   // contains the enumeration value that corresponds
   // to the MyChoice field value.
   [XmlIgnore]
   public ItemChoiceType EnumType;

   // The ManyChoices field can contain an array
   // of choices. Each choice must be matched to
   // an array item in the ChoiceArray field.
   [XmlChoiceIdentifier("ChoiceArray")]
   [XmlElement("Item", typeof(string))]
   [XmlElement("Amount", typeof(int))]
   [XmlElement("Temp", typeof(double))]
   public object[] ManyChoices;

   // TheChoiceArray field contains the enumeration
   // values, one for each item in the ManyChoices array.
   [XmlIgnore]
   public MoreChoices[] ChoiceArray;
}

[XmlType(IncludeInSchema=false)]
public enum ItemChoiceType{
   None,
   Word, 
   Number,
   DecimalNumber
}

public enum MoreChoices{
   None,
   Item,
   Amount,
   Temp
}

public class Test{
   static void Main(){
      Test t = new Test();
      t.SerializeObject("Choices.xml");
      t.DeserializeObject("Choices.xml");
   }

   private void SerializeObject(string
 filename){
      XmlSerializer mySerializer = 
      new XmlSerializer(typeof(Choices));
      TextWriter writer = new StreamWriter(filename);
      Choices myChoices = new Choices();

      // Set the MyChoice field to a string. Set the
      // EnumType to Word.
      myChoices.MyChoice= "Book";
      myChoices.EnumType = ItemChoiceType.Word;

      // Populate an object array with three items, one
      // of each enumeration type. Set the array to the 
      // ManyChoices field.
      object[] strChoices = new object[]{"Food",  5,
 98.6};
      myChoices.ManyChoices=strChoices;

      // For each item in the ManyChoices array, add an
      // enumeration value.
      MoreChoices[] itmChoices = new MoreChoices[]
      {MoreChoices.Item, 
      MoreChoices.Amount,
      MoreChoices.Temp};
      myChoices.ChoiceArray=itmChoices;
      
      mySerializer.Serialize(writer, myChoices);
      writer.Close();
   }

   private void DeserializeObject(string
 filename){
      XmlSerializer ser = new XmlSerializer(typeof(Choices));

      // A FileStream is needed to read the XML document.
      FileStream fs = new FileStream(filename, FileMode.Open);
      Choices myChoices = (Choices)
      ser.Deserialize(fs);
      fs.Close();

      // Disambiguate the MyChoice value using the enumeration.
      if(myChoices.EnumType == ItemChoiceType.Word){
             Console.WriteLine("Word: " +  
                 myChoices.MyChoice.ToString());
          }
      else if(myChoices.EnumType == ItemChoiceType.Number){
             Console.WriteLine("Number: " +
                 myChoices.MyChoice.ToString());
          }
      else if(myChoices.EnumType == ItemChoiceType.DecimalNumber){
             Console.WriteLine("DecimalNumber: " +
                 myChoices.MyChoice.ToString());
          }

      // Disambiguate the ManyChoices values using the enumerations.
      for(int i = 0; i<myChoices.ManyChoices.Length;
 i++){
      if(myChoices.ChoiceArray[i] == MoreChoices.Item)
          Console.WriteLine("Item: " + (string) myChoices.ManyChoices[i]);
      else if(myChoices.ChoiceArray[i] == MoreChoices.Amount)
          Console.WriteLine("Amount: " + myChoices.ManyChoices[i].ToString());
      if(myChoices.ChoiceArray[i] == MoreChoices.Temp)
          Console.WriteLine("Temp: " + (string) myChoices.ManyChoices[i].ToString());
          }
      
   }
}
#using <System.dll>
#using <System.xml.dll>

using namespace System;
using namespace System::Xml;
using namespace System::Xml::Serialization;
using namespace System::IO;

[XmlType(IncludeInSchema=false)]

public enum class ItemChoiceType
{
   None, Word, Number, DecimalNumber
};

public enum class MoreChoices
{
   None, Item, Amount, Temp
};

public ref class Choices
{
public:

   // The MyChoice field can be set to any one of 
   // the types below. 

   [XmlChoiceIdentifier("EnumType")]
   [XmlElement("Word",String::typeid)]
   [XmlElement("Number",Int32::typeid)]
   [XmlElement("DecimalNumber",Double::typeid)]
   Object^ MyChoice;

   // Don't serialize this field. The EnumType field
   // contains the enumeration value that corresponds
   // to the MyChoice field value.

   [XmlIgnore]
   ItemChoiceType EnumType;

   // The ManyChoices field can contain an array
   // of choices. Each choice must be matched to
   // an array item in the ChoiceArray field.

   [XmlChoiceIdentifier("ChoiceArray")]
   [XmlElement("Item",String::typeid)]
   [XmlElement("Amount",Int32::typeid)]
   [XmlElement("Temp",Double::typeid)]
   array<Object^>^ManyChoices;

   // TheChoiceArray field contains the enumeration
   // values, one for each item in the ManyChoices array.

   [XmlIgnore]
   array<MoreChoices>^ChoiceArray;
};

void SerializeObject( String^ filename );
void DeserializeObject( String^ filename );
int main()
{
   SerializeObject( "Choices.xml" );
   DeserializeObject( "Choices.xml" );
}

void SerializeObject( String^ filename )
{
   XmlSerializer^ mySerializer = gcnew XmlSerializer( Choices::typeid );
   TextWriter^ writer = gcnew StreamWriter( filename );
   Choices^ myChoices = gcnew Choices;

   // Set the MyChoice field to a string. Set the
   // EnumType to Word.
   myChoices->MyChoice = "Book";
   myChoices->EnumType = ItemChoiceType::Word;

   // Populate an object array with three items, one
   // of each enumeration type. Set the array to the 
   // ManyChoices field.
   array<Object^>^strChoices = {"Food",5,98.6};
   myChoices->ManyChoices = strChoices;

   // For each item in the ManyChoices array, add an
   // enumeration value.
   array<MoreChoices>^ itmChoices = {MoreChoices::Item,MoreChoices::Amount
,MoreChoices::Temp};
   myChoices->ChoiceArray = itmChoices;
   mySerializer->Serialize( writer, myChoices );
   writer->Close();
}

void DeserializeObject( String^ filename )
{
   XmlSerializer^ ser = gcnew XmlSerializer( Choices::typeid );

   // A FileStream is needed to read the XML document.
   FileStream^ fs = gcnew FileStream( filename,FileMode::Open );
   Choices^ myChoices = safe_cast<Choices^>(ser->Deserialize( fs ));
   fs->Close();

   // Disambiguate the MyChoice value using the enumeration.
   if ( myChoices->EnumType == ItemChoiceType::Word )
   {
      Console::WriteLine( "Word: {0}", myChoices->MyChoice->ToString()
 );
   }
   else
   if ( myChoices->EnumType == ItemChoiceType::Number )
   {
      Console::WriteLine( "Number: {0}", myChoices->MyChoice->ToString()
 );
   }
   else
   if ( myChoices->EnumType == ItemChoiceType::DecimalNumber
 )
   {
      Console::WriteLine( "DecimalNumber: {0}", myChoices->MyChoice->ToString()
 );
   }

   // Disambiguate the ManyChoices values using the enumerations.
   for ( int i = 0; i < myChoices->ManyChoices->Length;
 i++ )
   {
      if ( myChoices->ChoiceArray[ i ] == MoreChoices::Item
 )
            Console::WriteLine( "Item: {0}", myChoices->ManyChoices[
 i ] );
      else
      if ( myChoices->ChoiceArray[ i ] == MoreChoices::Amount
 )
            Console::WriteLine( "Amount: ", myChoices->ManyChoices[
 i ]->ToString() );
      if ( myChoices->ChoiceArray[ i ] == MoreChoices::Temp
 )
            Console::WriteLine( "Temp: {0}", myChoices->ManyChoices[
 i ]->ToString() );
   }
}
import System.*;
import System.Xml.*;
import System.Xml.Serialization.*;
import System.IO.*;
public class Choices
{
    // The myChoice field can be set to any one of 
    // the types below. 
    /** @attribute XmlElement("word", String.class)
     */
    /** @attribute XmlElement("Number", int.class)
     */
    /** @attribute XmlElement("DecimalNumber", double.class)
     */
    public Object myChoice;

    // Don't serialize this field. The EnumType field
    // contains the enumeration value that corresponds
    // to the myChoice field value.
    public int enumType;

    // The manyChoices field can contain an array
    // of choices. Each choice must be matched to
    // an array item in the choiceArray field.
    /** @attribute XmlElement("Item", String.class)
     */
    /** @attribute XmlElement("amount", int.class)
     */
    /** @attribute XmlElement("temp", double.class)
     */
    public Object manyChoices[];

    // ThechoiceArray field contains the enumeration
    // values, one for each item in the manyChoices array.
    public int choiceArray[];
} //Choices

/** @attribute XmlType(IncludeInSchema = false)
 */
public class ItemChoiceType
{
    public static final int
 none = 0;
    public static final int
 word = 1;
    public static final int
 number = 2;
    public static final int
 decimalNumber = 3;
} //ItemChoiceType

public class MoreChoices
{
    public static final int
 none = 0;
    public static final int
 item = 1;
    public static final int
 amount = 2;
    public static final int
 temp = 3;
} //MoreChoices

public class Test
{
    public static void main(String[]
 args)
    {
        Test t = new Test();
        t.SerializeObject("Choices.xml");
        t.DeserializeObject("Choices.xml");
    } //main

    private void SerializeObject(String fileName)
    {
        XmlSerializer mySerializer = new XmlSerializer(Choices.class.ToType());
        TextWriter writer = new StreamWriter(fileName);
        Choices myChoices = new Choices();
        // Set the myChoice field to a string. Set the
        // enumType to word.
        myChoices.myChoice = "Book";
        myChoices.enumType = ItemChoiceType.word;
        // Populate an object array with three items, one
        // of each enumeration type. Set the array to the 
        // manyChoices field.
        Object strChoices[] = new Object[] { "Food",
 (Int32)5,
            (System.Double)98.6 };
        myChoices.manyChoices = strChoices;
        // For each item in the manyChoices array, add an
        // enumeration value.
        int itmChoices[] = new int[]
 {
            MoreChoices.item, MoreChoices.amount, MoreChoices.temp
        };

        myChoices.choiceArray = new int[itmChoices.get_Length()];
        itmChoices.CopyTo(myChoices.choiceArray, 0);

        //myChoices.choiceArray = itmChoices;
        mySerializer.Serialize(writer, myChoices);
        writer.Close();
    } //SerializeObject

    private void DeserializeObject(String fileName)
    {
        XmlSerializer ser = new XmlSerializer(Choices.class.ToType());
        // A FileStream is needed to read the XML document.
        FileStream fs = new FileStream(fileName, FileMode.Open);
        Choices myChoices = (Choices)ser.Deserialize(fs);
        fs.Close();
        // Disambiguate the myChoice value using the enumeration.
        if (myChoices.enumType == ItemChoiceType.word) {
            Console.WriteLine("Word: " + myChoices.myChoice.ToString());
        }
        else {
            if (myChoices.enumType == ItemChoiceType.number) {
                Console.WriteLine("Number: " + myChoices.myChoice.ToString());
            }
            else {
                if (myChoices.enumType == ItemChoiceType.decimalNumber)
 {
                    Console.WriteLine("DecimalNumber: " +
                        myChoices.myChoice.ToString());
                }
            }
        }
        // Disambiguate the manyChoices values using the enumerations.
        for (int i = 0; i < myChoices.manyChoices.get_Length();
 i++) {
            if (System.Convert.ToInt32(myChoices.choiceArray.get_Item(i))
 ==
                MoreChoices.item) {
                Console.WriteLine("Item: " 
                    + (String)(myChoices.manyChoices.get_Item(i)));
            }
            else {
                if (System.Convert.ToInt32(myChoices.choiceArray.
                    get_Item(i)) == MoreChoices.amount) {
                    Console.WriteLine("Amount: " +
                        myChoices.manyChoices.get_Item(i).ToString());
                }
            }
            if (System.Convert.ToInt32(myChoices.choiceArray.
                get_Item(i)) == MoreChoices.temp) {
                Console.WriteLine("Temp: " + (String)(
                    myChoices.manyChoices.get_Item(i).ToString()));
            }
        }
    } //DeserializeObject 
} //Test
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlChoiceIdentifierAttribute クラス
XmlChoiceIdentifierAttribute メンバ
System.Xml.Serialization 名前空間

XmlChoiceIdentifierAttribute コンストラクタ (String)

XmlChoiceIdentifierAttribute クラス新しインスタンス初期化します。

名前空間: System.Xml.Serialization
アセンブリ: System.Xml (system.xml.dll 内)
構文構文

Dim name As String

Dim instance As New XmlChoiceIdentifierAttribute(name)
public XmlChoiceIdentifierAttribute (
    string name
)
public:
XmlChoiceIdentifierAttribute (
    String^ name
)
public XmlChoiceIdentifierAttribute (
    String name
)
public function XmlChoiceIdentifierAttribute
 (
    name : String
)

パラメータ

name

メンバ検出するために使用される列挙体を返すメンバ名。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlChoiceIdentifierAttribute クラス
XmlChoiceIdentifierAttribute メンバ
System.Xml.Serialization 名前空間

XmlChoiceIdentifierAttribute コンストラクタ

XmlChoiceIdentifierAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
XmlChoiceIdentifierAttribute () XmlChoiceIdentifierAttribute クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

XmlChoiceIdentifierAttribute (String) XmlChoiceIdentifierAttribute クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

XmlChoiceIdentifierAttribute クラス
XmlChoiceIdentifierAttribute メンバ
System.Xml.Serialization 名前空間

XmlChoiceIdentifierAttribute プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ .NET Compact Framework によるサポート TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。 ( Attribute から継承されます。)
参照参照

関連項目

XmlChoiceIdentifierAttribute クラス
System.Xml.Serialization 名前空間
XmlAttributes クラス

その他の技術情報

XML シリアル化概要
方法 : XML ストリーム代替要素名を指定する
属性使用した XML シリアル化制御
XML シリアル化の例
XML スキーマ定義ツール (Xsd.exe)

XmlChoiceIdentifierAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 ( Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

XmlChoiceIdentifierAttribute クラス
System.Xml.Serialization 名前空間
XmlAttributes クラス

その他の技術情報

XML シリアル化概要
方法 : XML ストリーム代替要素名を指定する
属性使用した XML シリアル化制御
XML シリアル化の例
XML スキーマ定義ツール (Xsd.exe)

XmlChoiceIdentifierAttribute メンバ

列挙体を使用してメンバ明確に検出できるようにすることを指定します

XmlChoiceIdentifierAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド XmlChoiceIdentifierAttribute オーバーロードされます。 XmlChoiceIdentifierAttribute クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ .NET Compact Framework によるサポート TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。(Attribute から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスハッシュ コード返します。 (Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラス既定値かどうか示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

XmlChoiceIdentifierAttribute クラス
System.Xml.Serialization 名前空間
XmlAttributes クラス

その他の技術情報

XML シリアル化概要
方法 : XML ストリーム代替要素名を指定する
属性使用した XML シリアル化制御
XML シリアル化の例
XML スキーマ定義ツール (Xsd.exe)


このページでは「.NET Framework クラス ライブラリ リファレンス」からXmlChoiceIdentifierAttributeを検索した結果を表示しています。
Weblioに収録されているすべての辞書からXmlChoiceIdentifierAttributeを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からXmlChoiceIdentifierAttribute を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「XmlChoiceIdentifierAttribute」の関連用語

XmlChoiceIdentifierAttributeのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



XmlChoiceIdentifierAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS