XML Serializable Dictionary Class
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Data
SerializableDictionary
SerializableDictionary_Caller
SerializableDictionary_Test
.gitignore
Doxyfile
LICENSE
README.md
SerializableDictionaryTest.sln

README.md

cs-SerializableDictionary

XML Serializable Dictionary Class

<?xml version="1.0" encoding="utf-8"?>
<SerializableDictionary key_type="Double" value_type="String">
  <item key="0.1" value="Zero" />
  <item key="1.2" value="One" />
  <item key="2.3" value="Two" />
</SerializableDictionary>
  • Example2) SerializableDictionary<int, MyData2> (MyData2 can convert from/to string.)
<?xml version="1.0" encoding="utf-8"?>
<SerializableDictionary key_type="Int32" value_type="MyData2">
  <item key="0" value="{ID:'0', Name:'Zero', RegisteredDate:'2014/10/20 01:59:26', Height:'170', }" />
  <item key="1" value="{ID:'1', Name:'One', RegisteredDate:'2014/10/20 01:59:26', Height:'160', }" />
  <item key="2" value="{ID:'2', Name:'Two', RegisteredDate:'2014/10/20 01:59:26', Height:'165', }" />
</SerializableDictionary>

XML Listable Dictionary Class

  • When the class has "getKey" method, exchange for a Dictionary with a List.
  • Example3) ListableDictionary<Positions, MyData5> (Positions is Enum. MyData5 has "getKey" method.)
<?xml version="1.0" encoding="utf-8"?>
<MyData5s KeyType="Positions" Count="4">
  <MyData5 Name="Alpha" Position="Floor1" HitPoint="100">
    <Weapon Name="Club" Owner="Alpha" />
  </MyData5>
  <MyData5 Name="Bravo" Position="Floor3" HitPoint="200">
    <Weapon Name="Mace" Owner="Bravo" />
  </MyData5>
  <MyData5 Name="Charlie" Position="Floor4" HitPoint="300">
    <Weapon Name="Hammer" Owner="Charlie" />
  </MyData5>
  <MyData5 Name="Delta" Position="FloorB1" HitPoint="500">
    <Weapon Name="Sword" Owner="Delta" />
  </MyData5>
</MyData5s>