まず、Javaで作成したアプリケーションを再作成しようとすると、C#で非常に新しいです。4つのリストボックスをリンクする
私は4つのリストボックスを持っています。各ボックスにはxmlファイルの値のリストが保持されます。
listBox_year for <Year>
<Make>
の場合は listBox_makeです。 <Model>
の listBox_model。 listBox_subModelは<sub-Model>
です。
したがって、年を重複せずにすべての年をlistBox_yearに追加することができます。一年をクリックすると、その年のすべてのMakeの自動車メイクが表示されます。次に、Makeをクリックすると、その年の下にMake Ssのモデルが表示されます。
Java withこの仕事をするためにHashMapを使用することができました。同じ名前と私は今年のキーがこれまでのキーを検索することができます。その年をキーとするすべてのメイクまたはバリューを取得します。ここで
は、XML形式は、Javaのハッシュマップに最も近いタイプ辞書である
<?xml version="1.0" encoding="utf-8" ?>
<vehicles>
<Manufacturer>
<Make>Subaru</Make>
<Year>2010</Year>
<Model>Impreza</Model>
<Sub-Model>2.0i</Sub-Model>
<Highway>36 MPG highway</Highway>
<City>27 MPG city</City>
<Price>$17,495</Price>
<Description>
Symmetrical All-Wheel Drive.
SUBARU BOXER® engine.
Seven airbags standard.
>Vehicle Dynamics Control (VDC).
</Description>
</Manufacturer>
<Manufacturer>
<Make>Toyota</Make>
<Year>2012</Year>
<Model>Supra</Model>
<Sub-Model>TT</Sub-Model>
<Highway>22 MPG highway</Highway>
<City>19 MPG city</City>
<Price>$48,795</Price>
<Description>
16-inch aluminum-alloy wheels.
6-speaker audio system w/iPod® control.
Bluetooth® hands-free phone and audio.
Available power moonroof.
</Description>
</Manufacturer>
<Manufacturer>
<Make>Subaru</Make>
<Year>2011</Year>
<Model>Impreza</Model>
<Sub-Model>2.0i Limited</Sub-Model>
<Highway>36 MPG highway</Highway>
<City>27 MPG city</City>
<Price>$18,795</Price>
<Description>
16-inch aluminum-alloy wheels.
6-speaker audio system w/iPod® control.
Bluetooth® hands-free phone and audio.
Available power moonroof.
</Description>
</Manufacturer>
<Manufacturer>
<Make>Subaru</Make>
<Year>2011</Year>
<Model>Impreza</Model>
<Sub-Model>2.0i Limited</Sub-Model>
<Highway>36 MPG highway</Highway>
<City>27 MPG city</City>
<Price>$18,795</Price>
<Description>
16-inch aluminum-alloy wheels.
6-speaker audio system w/iPod® control.
Bluetooth® hands-free phone and audio.
Available power moonroof.
</Description>
</Manufacturer>
</vehicles>
ご質問はありますか?あなたは 'Dictionary'を探していますか? – SLaks
コレクションが呼び出されたのはわかりませんが、@ lcfsethのように思えるように思われます。 –